Skip to content

Commit 85c7f3d

Browse files
Update for System.Diagnostics.DiagnosticSource
Update the comments and version for System.Diagnostics.DiagnosticSource to explicitly allow it to not match the .NET runtime version.
1 parent 06eff2a commit 85c7f3d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Directory.Packages.props

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
more specific patch which must be reference directly.
1111
-->
1212
<RuntimePackageVersions>9.0.0</RuntimePackageVersions>
13+
<SystemDiagnosticsDiagnosticSourceVersion>$(RuntimePackageVersions)</SystemDiagnosticsDiagnosticSourceVersion>
1314
<!--
1415
For modern .NET runtimes, match the major version of packages to the major version of the runtime.
1516
This is to ensure that the NuGet packages that users deploy match the support lifetimes of the .NET version they are using (i.e. LTS vs STS).
@@ -46,18 +47,11 @@
4647
<PackageVersion Include="OpenTracing" Version="[0.12.1,0.13)" />
4748

4849
<!--
49-
For modern .NET runtimes, match the major version of packages to the major version of the runtime.
50-
This is to ensure that the NuGet packages that users deploy match the support lifetimes of the .NET version they are using (i.e. LTS vs STS).
50+
System.Diagnostics.DiagnosticSource is exempted from the requirement to match the major version of
51+
the runtime so that new APIs and/or semantic conventions are available to all versions of .NET.
5152
See https://github.com/open-telemetry/opentelemetry-dotnet/issues/5973 for more details.
5253
-->
53-
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(RuntimePackageVersions)" />
54-
<!--
55-
However, for .NET 8 we need to use the .NET 9 package as the following APIs have been used to expose user-facing functionality:
56-
- System.Diagnostics.Activity.ctor(string, string, IEnumerable<KeyValuePair<string, object>>)
57-
- System.Diagnostics.Activity.AddException()
58-
- System.Diagnostics.Activity.AddLink()
59-
-->
60-
<PackageVersion Update="System.Diagnostics.DiagnosticSource" Version="9.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
54+
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
6155
</ItemGroup>
6256

6357
<ItemGroup>

0 commit comments

Comments
 (0)