Visual Studio 2022 - Errors and warnings - can't change Warning level

Viewed 631

I'm using Microsoft Visual Studio 2022 (64-bit) - 17.2.2. When I change project properties for a .NET 6 project I cant change Errors and warnings - Warning level. My current level is 6 - Warnings from C# 10

I'm trying to set this to either 7 - Warnings from C# 11 or 9999 - All warnings. What happens is I can set the value but the value is restored to 6 - Warnings from C# 10.

enter image description here

Setting other values work as expected.

Warning Level:

Specifies the level to display for compiler warnings. Higher levels produce more warnings, and include all warnings from lower levels.

https://docs.microsoft.com/en-us/visualstudio/ide/reference/build-page-project-designer-csharp?view=vs-2022#errors-and-warnings

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warninglevel

1 Answers

It seems to be a GUI bug. Even if the value is restored to 6 - Warnings from C# 10 in Visual Studio the .csproj file still gets modified if I press the save button with a value like <WarningLevel>9999</WarningLevel>.

enter image description here

Related