-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CS8032 error in VS2019 if EnforceCodeStyleInBuild is set and .NET SDK 6 is installed #23261
Comments
Maybe it will work if you add a global.json file that selects a .NET SDK version that is compatible with VS2019. |
Thank you for the suggestion! That does appear to work. I specifically tried the following global.json file:
Any chance we can get that information added to the EnforceCodeStyleInBuild documentation so this is easier for others to find? |
FYI @jaredpar |
#23261 (comment) - this is precisely correct. Tagging @gewarren if there is a user friendly way to doc these version compat requirements. |
#20355 seems related. Can the SDK detect that the code style analyzers require a higher version of Roslyn than what the process has already loaded, and then show a warning about that without even attempting to load the analyzer DLLs? |
Here's a minimal-ish project that reproduces the issue: TestLibrary.zip
If you just have VS2019 installed (and not .NET SDK 6), building the project in VS or via the command line (Developer Command Prompt for VS2019 -> msbuild -target:Rebuild TestLibrary.csproj) results in the following warnings (as expected):
If you then install .NET SDK 6 (or VS2022 which includes it), and try to build again (still using VS2019), you instead get the following set of warnings:
The IDExxxx warnings still appear in VS2019, but no longer appear in the command line build (I included the command line build output above). The CSxxxx and CAxxxx warnings stick around in both VS 2019 and the command line build.
I would expect that the presence of the .NET 6 SDK would not affect how VS2019 and its version of MSBuild work, but it appears that it does. Is there a way to restore the EnforceCodeStyleInBuild functionality besides uninstalling the .NET 6 SDK?
The text was updated successfully, but these errors were encountered: