|
9 | 9 | possible and only deviate (use a specific version) when a package has a
|
10 | 10 | more specific patch which must be reference directly.
|
11 | 11 | -->
|
12 |
| - <LatestRuntimeOutOfBandVer>9.0.0</LatestRuntimeOutOfBandVer> |
| 12 | + <RuntimePackageVersions>9.0.0</RuntimePackageVersions> |
| 13 | + <SystemDiagnosticsDiagnosticSourceVersion>$(RuntimePackageVersions)</SystemDiagnosticsDiagnosticSourceVersion> |
| 14 | + <!-- |
| 15 | + For modern .NET runtimes, match the major version of packages to the major version of the runtime. |
| 16 | + 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). |
| 17 | + See https://github.com/open-telemetry/opentelemetry-dotnet/issues/5973 for more details. |
| 18 | + --> |
| 19 | + <RuntimePackageVersions Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</RuntimePackageVersions> |
| 20 | + <RuntimePackageVersions Condition="'$(TargetFramework)' == 'net9.0'">9.0.0</RuntimePackageVersions> |
13 | 21 |
|
14 | 22 | <!-- Mitigate https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-43485. -->
|
15 | 23 | <SystemTextEncodingsWebOutOfBandMinimumCoreAppVer>8.0.0</SystemTextEncodingsWebOutOfBandMinimumCoreAppVer>
|
|
22 | 30 | vulnerability in the NuGet packages that are published from this repository.
|
23 | 31 | -->
|
24 | 32 | <ItemGroup>
|
25 |
| - <!-- |
26 |
| - Typically, for the Microsoft.Extensions.* packages relating to DI Abstractions, Hosting Abstractions, and Logging, |
27 |
| - the latest stable version should be used because: |
28 |
| - 1) Each major version bump will have some new API capabilities (e.g.For Logging, .NET 6 introduced compile-time logging |
29 |
| - source generation, .NET 8 introduced automatic event id generation). |
30 |
| - 2) Each minor version bump is normally security hotfixes or critical bug fixes. |
31 |
| - 3) Since version 3.1.0, the .NET runtime team is holding a high bar for backward compatibility on |
32 |
| - these packages even during major version bumps, so compatibility is not a concern here. |
33 |
| - --> |
34 |
| - <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" /> |
35 |
| - <PackageVersion Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" /> |
36 |
| - <PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" /> |
37 |
| - <PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="$(LatestRuntimeOutOfBandVer)" /> |
| 33 | + <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(RuntimePackageVersions)" /> |
| 34 | + <PackageVersion Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="$(RuntimePackageVersions)" /> |
| 35 | + <PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(RuntimePackageVersions)" /> |
| 36 | + <PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="$(RuntimePackageVersions)" /> |
38 | 37 |
|
39 | 38 | <!--
|
40 | 39 | OTel packages always point to latest stable release.
|
|
48 | 47 | <PackageVersion Include="OpenTracing" Version="[0.12.1,0.13)" />
|
49 | 48 |
|
50 | 49 | <!--
|
51 |
| - Typically, the latest stable version of System.Diagnostics.DiagnosticSource should be used here because: |
52 |
| - 1) Each major version bump will likely have some new OpenTelemetry capabilities (e.g. .NET 6 introduced Meter |
53 |
| - API, .NET 7 added UpDownCounter, .NET 8 added Meter/Instrument level attributes support, .NET 9 added |
54 |
| - Advice/Hint API, etc.). |
55 |
| - 2) Each minor version bump is normally security hotfixes or critical bug fixes. |
56 |
| - 3) The .NET runtime team provides extra backward compatibility guarantee to System.Diagnostics.DiagnosticSource |
57 |
| - even during major version bumps, so compatibility is not a concern here. |
| 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. |
| 52 | + See https://github.com/open-telemetry/opentelemetry-dotnet/issues/5973 for more details. |
58 | 53 | -->
|
59 |
| - <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(LatestRuntimeOutOfBandVer)" /> |
| 54 | + <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" /> |
60 | 55 | </ItemGroup>
|
61 | 56 |
|
62 | 57 | <ItemGroup>
|
|
96 | 91 | <PackageVersion Include="Microsoft.CSharp" Version="[4.7.0]" />
|
97 | 92 | <PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
|
98 | 93 | <PackageVersion Include="Microsoft.Coyote" Version="1.7.11" />
|
99 |
| - <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(LatestRuntimeOutOfBandVer)" /> |
100 |
| - <PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(LatestRuntimeOutOfBandVer)" /> |
101 |
| - <PackageVersion Include="Microsoft.Extensions.Http" Version="$(LatestRuntimeOutOfBandVer)" /> |
102 |
| - <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" /> |
| 94 | + <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(RuntimePackageVersions)" /> |
| 95 | + <PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(RuntimePackageVersions)" /> |
| 96 | + <PackageVersion Include="Microsoft.Extensions.Http" Version="$(RuntimePackageVersions)" /> |
| 97 | + <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(RuntimePackageVersions)" /> |
| 98 | + <!-- |
| 99 | + Microsoft.Extensions.Telemetry.Abstractions is not part of the .NET runtime and is supported |
| 100 | + at "tip", however the package multi-targets so that its dependencies match the major version |
| 101 | + of the runtime for each target framework so always uses the latest major version. |
| 102 | + --> |
103 | 103 | <PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[9.0.0,)" />
|
104 | 104 | <PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="[1.0.3,2.0)" />
|
105 | 105 | <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.13.0,18.0.0)" />
|
|
0 commit comments