Skip to content

WarningLevel is not always automatically set by AnalysisLevel #33559

Closed
@cremor

Description

@cremor

The article contains the following information:

Warning waves are enabled using the AnalysisLevel element in your project file.

A similar information is written in the article C# Compiler Options:

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.


Associated WorkItem - 436871

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-csharp/svcerrors-warnings/subsvcokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions