Open DavidZidar opened 2 years ago
I had to work around this issue by completely uninstalling Visual Studio 2022 preview.
It seems this is intended: #1292 last bullet point. It's painful for me too, but then I don't know the reasons behind 🤷
@CaringDev Oh damn, thanks for that link. That's just broken by design then. :(
Workaround: In C:\Program Files\dotnet\sdk, temporarily rename 6.0.200 to x6.0.200 while I don't need it.
This also has an impact on the GitHub Actions runner. They have been updated to the lastest SDK an now the dotnet format analyzers
command is broken.
Any news on this? This is pretty annoying to work with.
Agreed, I had to uninstall VS Preview again the other day because of this.
Any plan to fix this or introduce some sort of workaround to allow to use dotnet format
when you have a .NET preview version installed?
@JoeRobich can someone at least look at this, or give some feedback please.
The correct dotnet-format is being run based on global.json, but the issue here is that we are taking the highest versioned MSBuild (and thus SDK) returned by MSBuildLocator. This is a behavior that was quite useful when we shipped only as a dotnet tool but is undesirable now that we are in the SDK. This is something I can look at in the July development sprint.
@JoeRobich Thank you for the clarification 💯
A possible workaround is to install it as global tool
dotnet tool install -g dotnet-format --version "7.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json
(not sure if there is a different feed where 6.* is available)
and then running it as dotnet-format
Any news on this one? Can't find any PR for this.
The same in 8.0-Preview1.
It is not only the issue of preview version. Any SDK with only patch level difference is affected. E.g. 6.0.122 and 6.0.401.
This breaks our pull request build pipelines since the formatting in dotnet 8 seems to be a bit different from dotnet 6 which our global.json defines as the sdk. Any updates on an actual fix?
A possible workaround is to add this to your pipeline before the formatting:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
useGlobalJson: true
Please fix this.
I am unable to use dotnet format in my projects because it throws the following error:
This seems to be because it is trying to load assemblies from .NET 6.0.200 preview even though I have the following global.json in my project:
The following log output illustrates the problem: