Skip to content

Support .NET 11#6899

Draft
martincostello wants to merge 81 commits into
open-telemetry:mainfrom
martincostello:dotnet-vnext
Draft

Support .NET 11#6899
martincostello wants to merge 81 commits into
open-telemetry:mainfrom
martincostello:dotnet-vnext

Conversation

@martincostello

Copy link
Copy Markdown
Member

The intention is to keep this PR updated over the course of .NET 11's development as new previews are released.

Changes

Add support for building and testing with .NET 11.

  • Build with .NET 11 SDK
  • Add net11.0 target
  • Drop net8.0 and net9.0 targets

TODO

  • Use stable (or RC) SDK and NuGet package versions
  • Use fully-qualified container image tags (i.e. not 11.0-preview)
  • Remove workarounds for .NET 11 preview issues

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions Bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file documentation Documentation related pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package labels Feb 15, 2026
Comment thread src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListener.cs Outdated
@codecov

codecov Bot commented Feb 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.11111% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.18%. Comparing base (8592991) to head (b802571).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...penTelemetryProtocol/PersistentStorage/FileBlob.cs 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6899      +/-   ##
==========================================
- Coverage   90.21%   90.18%   -0.04%     
==========================================
  Files         287      287              
  Lines       15560    15575      +15     
==========================================
+ Hits        14038    14046       +8     
- Misses       1522     1529       +7     
Flag Coverage Δ
unittests-PowerShellScripts 88.49% <ø> (ø)
unittests-Project-Experimental 90.18% <86.11%> (-0.08%) ⬇️
unittests-Project-Stable 90.12% <86.11%> (-0.09%) ⬇️
unittests-Solution 90.06% <86.11%> (-0.18%) ⬇️
unittests-UnstableCoreLibraries-Experimental 50.57% <50.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nTelemetry.Api/Context/Propagation/B3Propagator.cs 89.83% <100.00%> (ø)
...metry.Api/Context/Propagation/BaggagePropagator.cs 93.78% <100.00%> (ø)
....Api/Context/Propagation/TraceContextPropagator.cs 90.49% <100.00%> (ø)
...c/OpenTelemetry.Api/Logs/LogRecordAttributeList.cs 74.78% <100.00%> (ø)
...yProtocol/Implementation/OtlpCertificateManager.cs 76.47% <ø> (-0.18%) ⬇️
...TelemetryProtocol/OtlpExporterOptionsExtensions.cs 99.10% <100.00%> (+<0.01%) ⬆️
...tocol/PersistentStorage/PersistentStorageHelper.cs 48.86% <100.00%> (+5.82%) ⬆️
.../PrometheusExporterApplicationBuilderExtensions.cs 100.00% <100.00%> (ø)
...rometheusExporterEndpointRouteBuilderExtensions.cs 100.00% <100.00%> (ø)
...ner/Internal/Shared/PrometheusCollectionManager.cs 90.37% <100.00%> (ø)
... and 7 more

... and 4 files with indirect coverage changes

@github-actions github-actions Bot added pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package labels Feb 15, 2026
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Feb 15, 2026
Update some references to .NET 8 to .NET 10 that were flushed out while working on open-telemetry#6899.
@Kielek Kielek added the keep-open Prevents issues and pull requests being closed as stale label Feb 16, 2026
- Add support for building and testing with .NET 11, initially using .NET 11 preview 1.
- Add `net11.0` TFMs.
- Drop `net8.0` and `net9.0` TFMs.
- Add workarounds for some issues pending their fixes.
Update System.Diagnostics.DiagnosticSource to 11.0.* that was missed in the previous commit and fix some missed analyzer warnings.
Copy-paste mistake.
Fix `NU1510` warning caused by workaround for aspnetcore issue.
Update CompatibilitySuppressions for .NET 11.
Add missing final new line.
@martincostello

This comment was marked as resolved.

@martincostello

This comment was marked as resolved.

@martincostello

Copy link
Copy Markdown
Member Author

Commit that should fix all the warnings just pushed. Will make a version targeting main tomorrow that doesn't contain C#-15-specific features (like [with(...)])- those specific changes can be reviewed and refined there (and potentially later broken up into smaller PRs by project).

@github-actions github-actions Bot added the pkg:OpenTelemetry.Exporter.InMemory Issues related to OpenTelemetry.Exporter.InMemory NuGet package label Mar 12, 2026
Fix-up tests to handle `ActivityTraceFlags.RandomTraceId`.
Update benchmarks to use `net11.0`.
Fix new code analysis warnings by using pattern matching.
Update to preview 5 of .NET 11.
Fix IDE0027 warning.
- Update compatibility suppressions.
- Add Prometheus snapshot.
Set the `SOURCE_DATE_EPOCH` to the date of the checked-out Git commit to use for NuGet's `DeterministicTimestamp` in .NET 11.
Populate switch statement to fix new analyser warning.
Suppress IDE0066 as otherwise it makes the code hard to read.
Comment thread Directory.Packages.props
Add missing override for newly added package.
@github-actions github-actions Bot added the pkg:OpenTelemetry.Shims.OpenTracing Issues related to OpenTelemetry.Shims.OpenTracing NuGet package label Jul 3, 2026
@github-actions github-actions Bot removed the pkg:OpenTelemetry.Shims.OpenTracing Issues related to OpenTelemetry.Shims.OpenTracing NuGet package label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Documentation related infra Infra work - CI/CD, code coverage, linters keep-open Prevents issues and pull requests being closed as stale perf Performance related pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package pkg:OpenTelemetry.Extensions.Propagators Issues related to OpenTelemetry.Extensions.Propagators NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants