-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Compiler needs to declaratively fail when loading newer analyzers #61252
Comments
|
Thanks for this. I see that my comment is quoted above. This I believe is a different issue, because the errors occur outside of Visual Studio i.e. when using "dotnet build". For example, we've needed to downgrade our Azure DevOps builds to .NET SDK 6.0.203 to avoid the issue. An example that I believe does describe this issue is here. |
This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - dotnet#61252 - dotnet/msbuild#7832 The package verification
This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - dotnet#61252 - dotnet/msbuild#7832 The package verification
This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - dotnet#61252 - dotnet/msbuild#7832 The package verification
This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - dotnet#61252 - dotnet/msbuild#7832 The package verification
* Framework compilers package for SDK consumption This is the Roslyn side of the fix for [msbuild 7832](dotnet/msbuild#7832) It provides a NuPkg that contains _only_ the .NET Framework version of the Roslyn compilers. This matches, almost identically, what is inserted into the MSBuild install of Visual Studio. The .NET SDK can now use this package to use a .NET Framework toolset when building C# and VB projects. This will resolve the analyzer inconsistency issues that come up when mixing .NET SDK and MSBuild Framework toolsets at different versions in CI. Related - #61252 - dotnet/msbuild#7832 The package verification * PR feedback * Full run only * YAML we meet again * round 2 YAML * make the pain stop * yaml variable expansion part 2 * yaml hates typos * wohoo a code bug! * it's always yaml * Apply suggestions from code review Co-authored-by: Jan Jones <[email protected]> * readme * can't type xml * Exclude from source build --------- Co-authored-by: Jan Jones <[email protected]>
The .NET SDK supports installation into older versions of Visual Studio. For example 17.0 installs the 6.0.100 SDK by default but loading 6.0.200, 6.0.300 is supported. While this is supported it means that there is a bit of a mismatch in which compiler is used:
msbuild
the C# compiler installed with Visual Studio is used.dotnet build
the compiler installed with the SDK is used.This means that analyzers and generators can experience two different compiler versions based on how the build is invoked. An analyzer / generator that depends on a new version of the Roslyn APIs can get into a situation where
dotnet build
succeeds butmsbuild
fails because the compiler with Visual Studio is too old. That ends up resulting in errors like the following:This situation has existed for a while but this error is becoming more common for a variety of reasons:
Given that we should address this scenario and I believe we should do so in two ways:
dotnet build
scenario. Using a warning means the customer is alerted to the problem and the build can continue.Examples of customers hitting this:
The text was updated successfully, but these errors were encountered: