You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Enhancement] Add net9.0 and net10.0 targets #1822
coverlet NuGet packages (coverlet.collector, coverlet.msbuild, coverlet.console, coverlet.MTP)
currently ship only a net8.0 TFM asset folder (driven by $(NetMinimum) = net8.0).
When a user's machine has only the .NET 9 or .NET 10 SDK installed the tracker class injected
at instrumentation time cannot load System.Runtime 8.0.0.0, causing a TypeInitializationException
at test-run time (see #1818).
Adding net9.0 and net10.0 TFM asset folders to each package allows the runtime assembly
resolver to pick the TFM-appropriate copy automatically.
Packages still pinned to 8.x must be bumped to 9.x/10.x-compatible versions:
Package
Current
Target
Microsoft.Bcl.AsyncInterfaces
8.0.0
9.0.0
Microsoft.Extensions.Configuration.Json
8.0.1
9.0.0
Microsoft.Extensions.DependencyInjection
8.0.1
9.0.0
Microsoft.Extensions.DependencyModel
8.0.2
9.0.0
Microsoft.Extensions.FileSystemGlobbing
8.0.0
9.0.0
Microsoft.Extensions.Logging.Abstractions
8.0.3
9.0.0
System.Collections.Immutable
8.0.0
9.0.0
System.Configuration.ConfigurationManager
8.0.1
9.0.0
System.Diagnostics.EventLog
8.0.2
9.0.0
System.IO.Pipelines
8.0.0
9.0.0
System.Reflection.Metadata
8.0.1
9.0.0
System.Text.Encoding.CodePages
8.0.0
9.0.0
System.Text.Json
8.0.6
9.0.0
Already at a compatible version — no change needed: Microsoft.Extensions.Configuration (10.0.1), System.Formats.Asn1 (10.0.0), System.Security.Cryptography.Pkcs (10.0.0).
Also update the MicrosoftBuildVersion comment from <!-- .NET 8.0 support --> to <!-- .NET 10.0 support --> and verify the package version supports the .NET 10 MSBuild
(current: 17.11.48).
4 · Source projects — add $(NetCurrent) to TargetFrameworks
Lines 23 and 27 hardcode ..\tasks\net8.0\. Replace with chained MSBuild version
conditions so the highest available TFM folder is chosen at MSBuild evaluation time.
Apply the same pattern for Windows (\) and non-Windows (/) variants:
<!-- Windows -->
<CoverletToolsPathCondition="'$(CoverletToolsPath)'=='' and '$(MSBuildRuntimeType)'=='Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '10.0'))">
$(MSBuildThisFileDirectory)..\tasks\net10.0\
</CoverletToolsPath>
<CoverletToolsPathCondition="'$(CoverletToolsPath)'=='' and '$(MSBuildRuntimeType)'=='Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '9.0'))">
$(MSBuildThisFileDirectory)..\tasks\net9.0\
</CoverletToolsPath>
<CoverletToolsPathCondition="'$(CoverletToolsPath)'=='' and '$(MSBuildRuntimeType)'=='Core'">
$(MSBuildThisFileDirectory)..\tasks\net8.0\
</CoverletToolsPath>
The netstandard2.0 fallback (non-Core MSBuild) remains unchanged.
<!-- Before -->
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_net8.0\</CoverletToolsPath>
<!-- After -->
<CoverletToolsPath>$(RepoRoot)artifacts\bin\coverlet.msbuild.tasks\$(Configuration.ToLowerInvariant())_$(NetMinimum)\</CoverletToolsPath>
7 · Unit-test projects — multi-target against NetMinimum and NetCurrent
Change literal net8.0 to $(NetMinimum);$(NetCurrent) (<TargetFrameworks> plural):
Keep the net8.0 and net9.0 runs — all three TFMs are tested in CI.
8c · Fix cleanup/delete step (line 62)
del coverlet.integration.determisticbuild\coverage.net8.0.cobertura.xmldel coverlet.integration.determisticbuild\coverage.net9.0.cobertura.xmldel coverlet.integration.determisticbuild\coverage.net10.0.cobertura.xml
9 · eng/azure-pipelines.yml — agent images
File: eng/azure-pipelines.yml
Verify windows-latest, ubuntu-latest, and macOS-latest Azure Pipelines agents
include the .NET 10 SDK (or that step 8a covers it). No matrix changes are required.
Verification
Build: dotnet build -c Debug — confirm artifacts/bin/coverlet.msbuild.tasks/
contains both debug_net8.0/ and debug_net10.0/ output folders.
Pack: dotnet pack -c Debug — inspect nupkgs; verify tasks/net8.0/, tasks/net10.0/ and lib/net8.0/, lib/net10.0/ entries are present.
Unit tests (multi-TFM):
dotnet test test/coverlet.core.tests/coverlet.core.tests.csproj -c Debug
dotnet test test/coverlet.collector.tests/coverlet.collector.tests.csproj -c Debug
dotnet test test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj -c Debug
dotnet test test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj -c Debug
Each should report results for both net8.0 and net10.0.
Integration tests (three TFMs):
dotnet test test/coverlet.integration.tests/... -f net8.0 -c Debug
dotnet test test/coverlet.integration.tests/... -f net9.0 -c Debug
dotnet test test/coverlet.integration.tests/... -f net10.0 -c Debug
Package validation: build with EnablePackageValidation=true; confirm no baseline
compatibility breaks for coverlet.collector and coverlet.msbuild.
CI: push to a *_validate branch to trigger all three OS × two configuration jobs
in Azure Pipelines; confirm green.
I don't see what enhancements for .NET 9 and 10 has to do with support for .NET Framework being completely broken by v8.
Thank you for raising this point. The changes in .NET 9 and 10 are not directly related to the issue, but I’d like to clarify the situation.
coverlet.core now depends on the System.Text.Json NuGet package, which requires the .NET 8.0 runtime for test execution. As part of this update, the major version was incremented to reflect the introduction of breaking changes.
If you’re unable to use the .NET 8 runtime, you can continue using Coverlet version 6.0.x, which remains compatible with earlier environments.
Anyway, you should test coverlet.msbuild V8.1.x again after the PR 1823 is merged. The nuget package will also target netstandard2.0 with required dependencies.
So, .NET Framework not working anymore is an intentional change, so the bugs people are reporting about it aren't actually bugs but "by design"?
The responses to the issues are giving mixed messages.
If it's a bug, it should be fixed (and the original issue reopened as users report it isn't actually resolved for them). The need for .NET to be installed should be irrelevant because .NET Framework is an independent product.
If it's not a bug, the issues should just be closed and users should be directed to find alternative solutions to coverlet where they need to support .NET Framework.
In my case I'm multi-targeting and I need a solution that works for both.
If the 6.x version isn't going to get any new features or maintenance, then as much as I've been a big fan of coverlet I'll need to switch to alternative tools.
Dropping support (or fundamentally breaking it unintentionally) for .NET Framework for a tool of this kind is unfortunate.
@martincostello Please provide a minimal repo for your scenario with an exact runtime environment description and I will run a test using a devcontainer. Please do not use an artificial runtime environment which will not exist on actual windows installations. This will be a one-time effort and not maintained.
Anyway, you should test coverlet.msbuild V8.1.x again after the PR 1823 is merged. The nuget package will also target netstandard2.0 with required dependencies.
Activity
Bertk commentedon Feb 18, 2026
Plan: Add net9.0 and net10.0 Targets
Steps
1 ·
Directory.Build.props— TFM variables and LangVersionFile:
Directory.Build.props<NetCurrent>net9.0</NetCurrent>→<NetCurrent>net10.0</NetCurrent><LangVersion>12.0</LangVersion>→<LangVersion>latest</LangVersion>2 ·
global.json— SDK pinFile:
global.json"version": "9.0.310"→"version": "10.0.100"(or the latest .NET 10 GA SDK build)3 ·
Directory.Packages.props— dependency versionsFile:
Directory.Packages.propsPackages still pinned to
8.xmust be bumped to 9.x/10.x-compatible versions:Microsoft.Bcl.AsyncInterfaces8.0.09.0.0Microsoft.Extensions.Configuration.Json8.0.19.0.0Microsoft.Extensions.DependencyInjection8.0.19.0.0Microsoft.Extensions.DependencyModel8.0.29.0.0Microsoft.Extensions.FileSystemGlobbing8.0.09.0.0Microsoft.Extensions.Logging.Abstractions8.0.39.0.0System.Collections.Immutable8.0.09.0.0System.Configuration.ConfigurationManager8.0.19.0.0System.Diagnostics.EventLog8.0.29.0.0System.IO.Pipelines8.0.09.0.0System.Reflection.Metadata8.0.19.0.0System.Text.Encoding.CodePages8.0.09.0.0System.Text.Json8.0.69.0.0Already at a compatible version — no change needed:
Microsoft.Extensions.Configuration(10.0.1),System.Formats.Asn1(10.0.0),System.Security.Cryptography.Pkcs(10.0.0).Also update the
MicrosoftBuildVersioncomment from<!-- .NET 8.0 support -->to<!-- .NET 10.0 support -->and verify the package version supports the .NET 10 MSBuild(current:
17.11.48).4 · Source projects — add
$(NetCurrent)to TargetFrameworkssrc/coverlet.collector/coverlet.collector.csproj$(NetMinimum)$(NetMinimum);$(NetCurrent)src/coverlet.console/coverlet.console.csproj$(NetMinimum)$(NetMinimum);$(NetCurrent)src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj$(NetMinimum);netstandard2.0$(NetMinimum);$(NetCurrent);netstandard2.0src/coverlet.MTP/coverlet.MTP.csprojnetstandard2.0;$(NetMinimum)netstandard2.0;$(NetMinimum);$(NetCurrent)src/coverlet.core/coverlet.core.csprojalready uses$(NetMinimum);$(NetCurrent);netstandard2.0— no change.5 ·
coverlet.msbuild.props— dynamic TFM path selectionFile:
src/coverlet.msbuild.tasks/buildMultiTargeting/coverlet.msbuild.propsLines 23 and 27 hardcode
..\tasks\net8.0\. Replace with chained MSBuild versionconditions so the highest available TFM folder is chosen at MSBuild evaluation time.
Apply the same pattern for Windows (
\) and non-Windows (/) variants:The
netstandard2.0fallback (non-Core MSBuild) remains unchanged.6 ·
test/Directory.Build.targets— fix hardcoded artifact pathFile:
test/Directory.Build.targets(line 17)7 · Unit-test projects — multi-target against NetMinimum and NetCurrent
Change literal
net8.0to$(NetMinimum);$(NetCurrent)(<TargetFrameworks>plural):test/coverlet.core.tests/coverlet.core.tests.csprojnet8.0test/coverlet.collector.tests/coverlet.collector.tests.csprojnet8.0test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csprojnet8.0test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj$(NetMinimum)test/coverlet.MTP.tests/coverlet.MTP.tests.csprojnet8.0test/coverlet.MTP.validation.tests/coverlet.MTP.validation.tests.csprojnet8.0All six become
<TargetFrameworks>$(NetMinimum);$(NetCurrent)</TargetFrameworks>.test/coverlet.integration.testsalready uses$(NetCurrent);$(NetMinimum)— no change.test/coverlet.integration.determisticbuilduses literalsnet9.0;net8.0; change to$(NetCurrent);$(NetMinimum).8 ·
eng/build.yml— CI SDK installs and test runsFile:
eng/build.yml8a · Install .NET 10 SDK
Add a third
UseDotNet@2step (after the existing 8.0.x and global.json steps):(Once
global.jsonis updated to 10.x theuseGlobalJson: truestep covers this;the explicit step is a safety net while migration is in progress.)
8b · Add net10.0 integration-test run
In the "Run unit tests with coverage" script, add alongside the existing
-f net8.0and-f net9.0steps:Keep the
net8.0andnet9.0runs — all three TFMs are tested in CI.8c · Fix cleanup/delete step (line 62)
9 ·
eng/azure-pipelines.yml— agent imagesFile:
eng/azure-pipelines.ymlVerify
windows-latest,ubuntu-latest, andmacOS-latestAzure Pipelines agentsinclude the .NET 10 SDK (or that step 8a covers it). No matrix changes are required.
Verification
dotnet build -c Debug— confirmartifacts/bin/coverlet.msbuild.tasks/contains both
debug_net8.0/anddebug_net10.0/output folders.dotnet pack -c Debug— inspect nupkgs; verifytasks/net8.0/,tasks/net10.0/andlib/net8.0/,lib/net10.0/entries are present.net8.0andnet10.0.EnablePackageValidation=true; confirm no baselinecompatibility breaks for
coverlet.collectorandcoverlet.msbuild.*_validatebranch to trigger all three OS × two configuration jobsin Azure Pipelines; confirm green.
File Change Summary
Directory.Build.propsNetCurrentnet9→net10,LangVersion12.0→latestglobal.jsonDirectory.Packages.propssrc/coverlet.collector/coverlet.collector.csproj$(NetCurrent)to TFMssrc/coverlet.console/coverlet.console.csproj$(NetCurrent)to TFMssrc/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj$(NetCurrent)to TFMssrc/coverlet.MTP/coverlet.MTP.csproj$(NetCurrent)to TFMssrc/coverlet.msbuild.tasks/buildMultiTargeting/coverlet.msbuild.propstest/Directory.Build.targets_net8.0with_$(NetMinimum)test/coverlet.core.tests/coverlet.core.tests.csproj$(NetMinimum);$(NetCurrent)test/coverlet.collector.tests/coverlet.collector.tests.csproj$(NetMinimum);$(NetCurrent)test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj$(NetMinimum);$(NetCurrent)test/coverlet.msbuild.tasks.tests/coverlet.msbuild.tasks.tests.csproj$(NetMinimum)→$(NetMinimum);$(NetCurrent)test/coverlet.MTP.tests/coverlet.MTP.tests.csproj$(NetMinimum);$(NetCurrent)test/coverlet.MTP.validation.tests/coverlet.MTP.validation.tests.csproj$(NetMinimum);$(NetCurrent)test/coverlet.integration.determisticbuild/coverlet.integration.determisticbuild.csproj$(NetCurrent);$(NetMinimum)eng/build.ymleng/azure-pipelines.ymlIntroduce .NET 10 support (coverlet-coverage#1822)
Introduce .NET 10 support (coverlet-coverage#1822)
Introduce .NET 10 support (coverlet-coverage#1822)
Introduce .NET 10 support (coverlet-coverage#1822)
Introduce .NET 10 support (coverlet-coverage#1822)
Introduce .NET 10 support (coverlet-coverage#1822)
martincostello commentedon Mar 22, 2026
I don't see what enhancements for .NET 9 and 10 has to do with support for .NET Framework being completely broken by v8.
Bertk commentedon Mar 22, 2026
Thank you for raising this point. The changes in .NET 9 and 10 are not directly related to the issue, but I’d like to clarify the situation.
coverlet.core now depends on the System.Text.Json NuGet package, which requires the .NET 8.0 runtime for test execution. As part of this update, the major version was incremented to reflect the introduction of breaking changes.
If you’re unable to use the .NET 8 runtime, you can continue using Coverlet version 6.0.x, which remains compatible with earlier environments.
Anyway, you should test coverlet.msbuild V8.1.x again after the PR 1823 is merged. The nuget package will also target netstandard2.0 with required dependencies.
martincostello commentedon Mar 22, 2026
So, .NET Framework not working anymore is an intentional change, so the bugs people are reporting about it aren't actually bugs but "by design"?
The responses to the issues are giving mixed messages.
If it's a bug, it should be fixed (and the original issue reopened as users report it isn't actually resolved for them). The need for .NET to be installed should be irrelevant because .NET Framework is an independent product.
If it's not a bug, the issues should just be closed and users should be directed to find alternative solutions to coverlet where they need to support .NET Framework.
In my case I'm multi-targeting and I need a solution that works for both.
If the 6.x version isn't going to get any new features or maintenance, then as much as I've been a big fan of coverlet I'll need to switch to alternative tools.
Dropping support (or fundamentally breaking it unintentionally) for .NET Framework for a tool of this kind is unfortunate.
Bertk commentedon Mar 22, 2026
@martincostello Please provide a minimal repo for your scenario with an exact runtime environment description and I will run a test using a devcontainer. Please do not use an artificial runtime environment which will not exist on actual windows installations. This will be a one-time effort and not maintained.
46 remaining items
chore(csharp): bump coverlet.collector from 6.0.4 to 10.0.1 (#52)
chore(csharp): Bump coverlet.collector from 8.0.1 to 10.0.1 (#4347)
Bump coverlet.msbuild from 8.0.0 to 10.0.1 (#330)
chore(deps): Bump the test-dependencies group with 1 update (#34)
Bump coverlet.collector from 8.0.1 to 10.0.1 (#52)
chore(deps): Bump coverlet.collector from 6.0.2 to 10.0.1 (#13)
Bump coverlet.collector and 3 others (#6)
Bump coverlet.collector from 6.0.4 to 10.0.1 (#19)
Bump coverlet.collector and 7 others (#86)
chore: Bump coverlet.collector from 8.0.1 to 10.0.1 (#283)
Bump coverlet.collector from 6.0.4 to 10.0.1 (#6)
[nuget][Find]- Bump Azure.Identity and 26 others (#705)
Bump the test-dependencies group with 3 updates (#2)
Bump coverlet.msbuild from 8.0.0 to 10.0.1 (#893)
chore(deps): Bump coverlet.collector from 6.0.4 to 10.0.1 (#438)