Skip to content

Outer build of multitargeted projects doesn't respect WarningsNotAsErrors #10873

@rainersigwald

Description

@rainersigwald

The promotion of the "plain property" version of some warning-related settings:

<PropertyGroup>
<MSBuildWarningsAsMessages Condition="'$(MSBuildWarningsAsMessages)'==''">$(NoWarn)</MSBuildWarningsAsMessages>
<MSBuildWarningsAsErrors Condition="'$(MSBuildWarningsAsErrors)'==''">$(WarningsAsErrors)</MSBuildWarningsAsErrors>
<MSBuildWarningsNotAsErrors Condition="'$(MSBuildWarningsNotAsErrors)'==''">$(WarningsNotAsErrors)</MSBuildWarningsNotAsErrors>
</PropertyGroup>

Is in Microsoft.Common.CurrentVersion.targets, which is not imported into multitargeting outer builds--only the inner builds. This means that any warnings raised in the outer build (like in NuGet operations) may be promoted to error even if $(WarningsNotAsErrors) includes them.

This is very related to #10877 and we should consider fixing both by looking at the unprefixed versions in the engine (if the prefixed version is unset) rather than requiring XML logic to do it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions