|
6 | 6 | </PropertyGroup> |
7 | 7 |
|
8 | 8 | <!-- |
9 | | - This section covers packages that are directly referenced by the NuGet packages published from this repository. |
10 | | - Any security vulnerability in these packages or their downstream dependencies will be considered as a security |
11 | | - vulnerability in the NuGet packages that are published from this repository. |
| 9 | + For modern .NET runtimes, match the major version of packages to the major version of the runtime. |
| 10 | + 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). |
| 11 | + See https://github.com/open-telemetry/opentelemetry-dotnet/issues/5973 for more details. |
12 | 12 | --> |
13 | 13 | <ItemGroup> |
14 | | - <!-- |
15 | | - Typically, for the Microsoft.Extensions.* packages relating to DI Abstractions, Hosting Abstractions, and Logging, |
16 | | - the latest stable version should be used because: |
17 | | - 1) Each major version bump will have some new API capabilities (e.g.For Logging, .NET 6 introduced compile-time logging |
18 | | - source generation, .NET 8 introduced automatic event id generation). |
19 | | - 2) Each minor version bump is normally security hotfixes or critical bug fixes. |
20 | | - 3) Since version 3.1.0, the .NET runtime team is holding a high bar for backward compatibility on |
21 | | - these packages even during major version bumps, so compatibility is not a concern here. |
22 | | - --> |
| 14 | + <!-- Default to latest versions for all TFMs --> |
23 | 15 | <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[9.0.0,)" /> |
24 | 16 | <PackageVersion Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="[9.0.0,)" /> |
25 | 17 | <PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="[9.0.0,)" /> |
26 | 18 | <PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="[9.0.0,)" /> |
| 19 | + </ItemGroup> |
| 20 | + <!-- Version overrides for specific netX.0 TFMs --> |
| 21 | + <ItemGroup Condition="'$(TargetFramework)' == 'net8.0'"> |
| 22 | + <PackageVersion Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0,)" /> |
| 23 | + <PackageVersion Update="Microsoft.Extensions.Diagnostics.Abstractions" Version="[8.0.0,)" /> |
| 24 | + <PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="[8.0.0,)" /> |
| 25 | + <PackageVersion Update="Microsoft.Extensions.Logging.Configuration" Version="[8.0.0,)" /> |
| 26 | + </ItemGroup> |
| 27 | + <ItemGroup Condition="'$(TargetFramework)' == 'net9.0'"> |
| 28 | + <PackageVersion Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[9.0.0,)" /> |
| 29 | + <PackageVersion Update="Microsoft.Extensions.Diagnostics.Abstractions" Version="[9.0.0,)" /> |
| 30 | + <PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="[9.0.0,)" /> |
| 31 | + <PackageVersion Update="Microsoft.Extensions.Logging.Configuration" Version="[9.0.0,)" /> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <!-- |
| 35 | + System.Diagnostics.DiagnosticSource is exempted from the requirement to match the major version of |
| 36 | + the runtime so that new APIs and/or semantic conventions are available to all versions of .NET. |
| 37 | + See https://github.com/open-telemetry/opentelemetry-dotnet/issues/5973 for more details. |
| 38 | + --> |
| 39 | + <ItemGroup> |
| 40 | + <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="[9.0.0,)" /> |
| 41 | + </ItemGroup> |
27 | 42 |
|
| 43 | + <!-- |
| 44 | + This section covers packages that are directly referenced by the NuGet packages published from this repository. |
| 45 | + Any security vulnerability in these packages or their downstream dependencies will be considered as a security |
| 46 | + vulnerability in the NuGet packages that are published from this repository. |
| 47 | + --> |
| 48 | + <ItemGroup> |
28 | 49 | <!-- |
29 | 50 | OTel packages always point to latest stable release. |
30 | 51 | --> |
|
35 | 56 | <PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="[$(OTelLatestStableVer),2.0)" /> |
36 | 57 | <PackageVersion Include="OpenTelemetry.Extensions.Propagators" Version="[$(OTelLatestStableVer),2.0)" /> |
37 | 58 | <PackageVersion Include="OpenTracing" Version="[0.12.1,0.13)" /> |
38 | | - |
39 | | - <!-- |
40 | | - Typically, the latest stable version of System.Diagnostics.DiagnosticSource should be used here because: |
41 | | - 1) Each major version bump will likely have some new OpenTelemetry capabilities (e.g. .NET 6 introduced Meter |
42 | | - API, .NET 7 added UpDownCounter, .NET 8 added Meter/Instrument level attributes support, .NET 9 added |
43 | | - Advice/Hint API, etc.). |
44 | | - 2) Each minor version bump is normally security hotfixes or critical bug fixes. |
45 | | - 3) The .NET runtime team provides extra backward compatibility guarantee to System.Diagnostics.DiagnosticSource |
46 | | - even during major version bumps, so compatibility is not a concern here. |
47 | | - --> |
48 | | - <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="[9.0.0,)" /> |
49 | 59 | </ItemGroup> |
50 | 60 |
|
51 | 61 | <ItemGroup> |
|
0 commit comments