-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotnet format doesn't write to disk after updating to dotnet SDK 9.0.200 #47012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
1 similar comment
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I've run into this exact same issue. Reproduced on MacOS. |
Hello @dotnet/roslyn-ide do we have some information on this? |
This issue is caused by the same sdk/src/BuiltInTools/dotnet-format/Workspaces/FolderWorkspace.cs Lines 51 to 59 in 9c64e2f
A fix has been merged that should flow into the 9.0.2xx SDK (see dotnet/roslyn#77362). I have confirmed that the issue is fixed in the nightly .NET 10 build. |
Verified that the nightly 9.0.300 build works, also found the insertion of the fix into the 9.0.2xx branch (See #46931) |
Thank for the confirmation @JoeRobich |
Describe the bug
dotnet format
doesn't write formatting changes back to the file after updating the dotnet SDK to 9.0.200. It works up to 9.0.102.To Reproduce
csharp_bad_01.cs
in the current working directory with the following contents (ensure to respect spaces and blank lines):Run
docker run --rm -it --entrypoint /bin/ash -v $(pwd):/app mcr.microsoft.com/dotnet/sdk:9.0.200-alpine3.21
Run
cd /app
Hash the content of the file:
sha256sum csharp_bad_01.cs
. Output:dotnet format whitespace --folder --exclude / --include csharp_bad_01.cs -v diag --verify-no-changes
. Output:dotnet format whitespace --folder --exclude / --include csharp_bad_01.cs -v diag
. Output:sha256sum csharp_bad_01.cs
, observing that it has the same hash as before, and the same content. Output:If you repeat the steps described above using the
9.0.102-alpine3.21
container image, you can observe thatdotnet format
correctly writes the formatted file.Exceptions (if any)
Further technical details
dotnet --info
:Also, not sure if #46780 is related to this.
The text was updated successfully, but these errors were encountered: