Skip to content

Commit 3e0a933

Browse files
authored
Fix NoWarn for Datadog.Trace and Trimming (#6745)
## Summary of changes They were lacking $(NoWarn) and when installed would override any Directory.Build.props that had NoWarn set. This depended / required on when MSBuild would evaluate the properties. ## Reason for change We shouldn't overwrite these. ## Implementation details Added `$(NoWarn)` ## Test coverage Reproduced locally: Added a `Directory.Build.props` in a different project then installed `Datadog.Trace` as a NuGet ```xml <Project> <PropertyGroup> <NoWarn>$(NoWarn);CA2200</NoWarn> </PropertyGroup> </Project> ``` Created a warning like so ``` try { return true; } catch (Exception e) { throw e; } ``` Warning not ignored. ## Other details <!-- Fixes #{issue} --> Fixes #6742 <!-- ⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
1 parent 8b0b501 commit 3e0a933

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

tracer/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<!-- WebClient is obsolete -->
1414
<!-- NU* are workaround for Rider bug: https://youtrack.jetbrains.com/issue/RIDER-103207/Cannot-suppress-vulnerable-package-errors -->
15-
<NoWarn>SYSLIB0014;NU1901;NU1902;NU1903;NU1904</NoWarn>
15+
<NoWarn>$(NoWarn);SYSLIB0014;NU1901;NU1902;NU1903;NU1904</NoWarn>
1616
</PropertyGroup>
1717

1818
<!-- StyleCop -->

tracer/src/Datadog.Trace.BenchmarkDotNet/Datadog.Trace.BenchmarkDotNet.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1515
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1616
<!-- NU* are workaround for Rider bug: https://youtrack.jetbrains.com/issue/RIDER-103207/Cannot-suppress-vulnerable-package-errors -->
17-
<NoWarn>NU5100;NU5128;NU1901;NU1902;NU1903;NU1904</NoWarn>
17+
<NoWarn>$(NoWarn);NU5100;NU5128;NU1901;NU1902;NU1903;NU1904</NoWarn>
1818
<PackageOutputPath Condition="'$(PackageOutputPath)' == '' ">bin\$(Configuration)\packages</PackageOutputPath>
1919
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
2020
</PropertyGroup>

tracer/src/Datadog.Trace.Bundle/Datadog.Trace.Bundle.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
1212
<!-- NU* are workaround for Rider bug: https://youtrack.jetbrains.com/issue/RIDER-103207/Cannot-suppress-vulnerable-package-errors -->
13-
<NoWarn>NU5100;NU5128;NU1901;NU1902;NU1903;NU1904</NoWarn>
13+
<NoWarn>$(NoWarn);NU5100;NU5128;NU1901;NU1902;NU1903;NU1904</NoWarn>
1414
<PackageOutputPath Condition="'$(PackageOutputPath)' == '' ">bin\$(Configuration)\packages</PackageOutputPath>
1515
</PropertyGroup>
1616

tracer/src/Datadog.Trace.Manual/Datadog.Trace.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Copyright 2017 Datadog, Inc.
99
<PropertyGroup>
1010
<!-- IL2007: Could not resolve assembly specified in descriptor file -->
1111
<!-- IL2008: Could not resolve type specified in descriptor file -->
12-
<NoWarn>IL2007;IL2008</NoWarn>
12+
<NoWarn>$(NoWarn);IL2007;IL2008</NoWarn>
1313
</PropertyGroup>
1414

1515
<ItemGroup>

tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Copyright 2017 Datadog, Inc.
99
<PropertyGroup>
1010
<!-- IL2007: Could not resolve assembly specified in descriptor file -->
1111
<!-- IL2008: Could not resolve type specified in descriptor file -->
12-
<NoWarn>IL2007;IL2008</NoWarn>
12+
<NoWarn>$(NoWarn);IL2007;IL2008</NoWarn>
1313
</PropertyGroup>
1414

1515
<ItemGroup>

0 commit comments

Comments
 (0)