Skip to content

[WIP] Support .NET 10 #6307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

martincostello
Copy link
Member

Changes

Add support for building and testing with .NET 10.

Initially using .NET 10 preview 4, will update as previews progress.

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.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol 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 labels Jun 7, 2025
Copy link

codecov bot commented Jun 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.74%. Comparing base (3f86f47) to head (d7b4e05).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6307      +/-   ##
==========================================
- Coverage   86.76%   86.74%   -0.02%     
==========================================
  Files         258      258              
  Lines       11879    11879              
==========================================
- Hits        10307    10305       -2     
- Misses       1572     1574       +2     
Flag Coverage Δ
unittests-Project-Experimental 86.65% <ø> (+0.33%) ⬆️
unittests-Project-Stable 86.34% <ø> (-0.32%) ⬇️
unittests-Solution 86.72% <ø> (+0.28%) ⬆️
unittests-UnstableCoreLibraries-Experimental 85.78% <ø> (ø)

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

see 4 files with indirect coverage changes

@martincostello
Copy link
Member Author

I don't know why the w3c-trace-context integration tests are failing.

@github-actions github-actions bot removed 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 labels Jun 8, 2025
@martincostello
Copy link
Member Author

I don't know why the w3c-trace-context integration tests are failing.

Caused by this breaking change - just need to work out it seems to be applying to .NET 8, 9 & 10 in the W3C tests and why manually setting it back isn't working.

@martincostello
Copy link
Member Author

just need to work out it seems to be applying to .NET 8, 9 & 10 in the W3C tests

Fixed the .NET 10 tests - the .NET 8 and 9 tests are failing because the .NET 8 and 9 runtimes aren't present in the docker image, so it rolls forward to .NET 10, then the breaking change applies (but can't be turned off because the new API is missing), so the tests fail.

@martincostello
Copy link
Member Author

martincostello commented Jun 12, 2025

Fixed the .NET 10 tests - the .NET 8 and 9 tests are failing because the .NET 8 and 9 runtimes aren't present in the docker image, so it rolls forward to .NET 10, then the breaking change applies (but can't be turned off because the new API is missing), so the tests fail.

This wasn't correct - the actual reason was that all TFMs were referencing the 10.0.* package, so the breaking change was being applied. The fix was to use the workaround with all the TFMs.

Might need tweaking depending on the outcome of #6327.

Add support for building and testing with .NET 10, initially using .NET 10 preview 4.
Ensure the .NET 8 and 9 runtimes are present.
Use the .NET 10 SDK to build.
Remove obsolete attribute from compose file.
React to breaking change in .NET 10.
Remove leftover debug code.
Move the workaround to a static constructor so it runs early enough to affect the tests.
Update to preview 5 of .NET 10.
All TFMs are referencing the .NET 10 package, so the workaround needs applying to all of them.
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Jun 13, 2025
Improve developer experience when troubleshooting failing tests (like I was in open-telemetry#6307) by logging both stderr and stdout and ignoring warnings in the upstream Python tests.
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Jun 18, 2025
Improve developer experience when troubleshooting failing tests (like I was in open-telemetry#6307) by logging both stderr and stdout and ignoring warnings in the upstream Python tests.
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Jun 18, 2025
Improve developer experience when troubleshooting failing tests (like I was in open-telemetry#6307) by logging both stderr and stdout and ignoring warnings in the upstream Python tests.
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Jun 19, 2025
Improve developer experience when troubleshooting failing tests (like I was in open-telemetry#6307) by logging both stderr and stdout and ignoring warnings in the upstream Python tests.
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 pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant