Skip to content

Add option for "warning as errors except ..." #3062

@natemcmaster

Description

@natemcmaster

Follow up to #68

I would like to have the ability to make all warnings by errors, but with some exclusions.

msbuild.exe -warnAsError -warnNotAsError MSB3277

This is not the same as -nowarn which would make the warning a low-importance message and hide the warning. I still want the warnings to appear as warnings so show the user there may be a problem, but I want to be able to specify which problems are non-fatal.

My scenario:
We would like to enable -warnAsError by default in the build system that produces ASP.NET Core, but we can't because there are a handful of warning that we can't always do anything about. We would like the warnings to appear, but to be non-fatal to a build passing.

For comparison, C# supports a WarningsNotAsErrors properties which allows users to set TreatWarningsAsErrors=true which exclusions defined as WarningsNotAsErrors.

Metadata

Metadata

Assignees

Labels

Area: DocumentationIssues about docs, including errors and areas we should extend (this repo and learn.microsoft.com)triaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions