diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs index 1e7259bd2..ef2183979 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs @@ -55,7 +55,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules compilerOptions => compilerOptions.PreserveCompilationContext != null && compilerOptions.PreserveCompilationContext.Value); private AddPropertyTransform WarningsAsErrorsTransform => - new AddPropertyTransform("WarningsAsErrors", + new AddPropertyTransform("TreatWarningsAsErrors", compilerOptions => compilerOptions.WarningsAsErrors.ToString().ToLower(), compilerOptions => compilerOptions.WarningsAsErrors != null && compilerOptions.WarningsAsErrors.Value); diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs index ff7321215..521618155 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs @@ -193,8 +193,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests } }"); - mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(1); - mockProj.Properties.First(p => p.Name == "WarningsAsErrors").Value.Should().Be("true"); + mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(1); + mockProj.Properties.First(p => p.Name == "TreatWarningsAsErrors").Value.Should().Be("true"); mockProj = RunBuildOptionsRuleOnPj(@" { @@ -203,7 +203,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests } }"); - mockProj.Properties.Count(p => p.Name == "WarningsAsErrors").Should().Be(0); + mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(0); } [Fact]