From 64b1c18b2ff20082ec952eb431b4d68da94fe8ee Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 9 Apr 2026 02:07:29 +0000 Subject: [PATCH 1/2] Backflow from https://github.com/dotnet/dotnet / 0cf6b19 build 309569 [[ commit created by automation ]] --- eng/common/tools.ps1 | 2 +- eng/common/tools.sh | 2 +- src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index ab0675dc9e0..e28db6c7c8f 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -777,7 +777,7 @@ function MSBuild-Core() { $cmdArgs += ' /p:TreatWarningsAsErrors=false' } - if ($warnNotAsError) { + if ($warnAsError -and $warnNotAsError) { $cmdArgs += " /warnnotaserror:$warnNotAsError /p:AdditionalWarningsNotAsErrors=$warnNotAsError" } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index ee23e7e64a6..1e37fd95b21 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -538,7 +538,7 @@ function MSBuild-Core { fi local warnnotaserror_switch="" - if [[ -n "$warn_not_as_error" ]]; then + if [[ -n "$warn_not_as_error" && "$warn_as_error" == true ]]; then warnnotaserror_switch="/warnnotaserror:$warn_not_as_error /p:AdditionalWarningsNotAsErrors=$warn_not_as_error" fi diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props index b8cb8efe741..e593a1373eb 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props @@ -32,6 +32,10 @@ false + + $(NoWarn);$(AdditionalNoWarn) + $(WarningsNotAsErrors);$(AdditionalWarningsNotAsErrors) +