You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
dotnet format command is broken in 9.0.200 that was installed by Visual Studio and no update is available as of now. #46780
I want to be able to run dotnet format command that is part of 8.x.x but it doesn't seem possible. I tried using a global.json file to pin .net 8 to my project but format command still uses 9.0.200 on my machine.
Describe the solution you'd like
dotnet format command to respect pinned sdk in global.json file.
I suppose the "LatestMajor" setting comes from dotnet/format#694. I don't know what that PR was intended to fix and whether "LatestMajor" is still necessary after #38857.
However, if the .NET Runtime version 9.0.2 causes dotnet-format to fail with the "source text did not have an identifiable encoding" error that is shown in #46780, then that seems a breaking change that may hurt other applications as well.
In contrast, if the error is more connected to the version of dotnet-format itself, then I don't expect that removing the "LatestMajor" setting will fix it.
In my testing with .NET SDK versions 8.0.309, 9.0.103, and 9.0.200 installed and global.json pointing to 8.0.309, the dotnet-format binary came from .NET SDK 8.0.309 even though it was executed on .NET Runtime 9.0.2.
Is your feature request related to a problem? Please describe.
dotnet format
command is broken in 9.0.200 that was installed by Visual Studio and no update is available as of now. #46780I want to be able to run
dotnet format
command that is part of 8.x.x but it doesn't seem possible. I tried using a global.json file to pin .net 8 to my project but format command still uses 9.0.200 on my machine.Describe the solution you'd like
dotnet format
command to respect pinned sdk inglobal.json
file.Additional context
global.json to pin dotnet 8 to my project
SDKs installed on my machine:
SDK dotnet command uses after pinning via
global.json
dotnet build respects pinned version
dotnet format does not respect pinned version
The text was updated successfully, but these errors were encountered: