However, the .NET SDK sets the WarningLevel to match the AnalysisLevel in your project file.
This is not entirely true. It is true for .NET 7 projects. But it isn't true for old .NET Framework projects, even if they use a SDK style csproj file. For those projects you have to explicitly set <WarningLevel> to get warnings from warning waves.
Note: This might be a change in the .NET 7 SDK. If I remember correctly the .NET 6 SDK worked as documented, even for .NET Framework projects. See dotnet/sdk#24826
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: fe4ec697-f3a5-3df8-8e43-e49df4f3303b
Version Independent ID: ee47f321-8c41-a867-c25e-4020b7aa75eb
The article contains the following information:
A similar information is written in the article C# Compiler Options:
This is not entirely true. It is true for .NET 7 projects. But it isn't true for old .NET Framework projects, even if they use a SDK style csproj file. For those projects you have to explicitly set
<WarningLevel>
to get warnings from warning waves.Note: This might be a change in the .NET 7 SDK. If I remember correctly the .NET 6 SDK worked as documented, even for .NET Framework projects. See dotnet/sdk#24826
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.