Summary
For a test project multi-targeting net48 and net10.0-windows, TeamCity’s .NET dotnet test build step (with JetBrains dotCover in our case) fails to discover/execute tests on net48, while the same solution run via a Command Line step (dotnet test without dotCover) discovers and runs tests on both target frameworks.
Changing the modern TFM to net8.0-windows (i.e. net48;net8.0-windows) restores correct behavior for both TFMs with the .NET runner.
Environment
- TeamCity 2025.11.2 (build 208045)
- .NET SDK 10.0.202 on the build agent (Windows)
- Test project:
se.Trimble.PT.ScriptEditor.Test with <TargetFrameworks>net48;net10.0-windows</TargetFrameworks>
- Solution:
VS DotNet PT ScriptEditor.sln
Steps to reproduce
- Create (or use) a test project with
<TargetFrameworks>net48;net10.0-windows</TargetFrameworks> and MSTest-based tests.
- Add two build steps against the same solution, same arguments in spirit:
- Command Line:
dotnet test "VS DotNet PT ScriptEditor.sln" --configuration Release --no-restore --no-build (plus any filters you use)
- .NET →
dotnet test runner (optionally with dotCover coverage enabled — our failing case uses dotCover wrapping dotnet test)
- Run the build on an agent with .NET 10 SDK installed.
Expected
Both TFMs are discovered and executed; TeamCity reports tests for net48 and net10.0-windows (same as plain dotnet test).
Actual
- CLI
dotnet test: runs net48 and net10.0-windows successfully.
- .NET runner (
dotnet test via TeamCity / dotCover): net48 discovery fails; net10.0-windows runs.
Evidence (TeamCity build log excerpts)
From the .NET runner step (dotCover + dotnet test), during the net48 test host session:
Build_VS_DotNet_PT_ScriptEditor_1.2.4-alpha-STA-13748-update-se.113.log
Summary
For a test project multi-targeting
net48andnet10.0-windows, TeamCity’s .NETdotnet testbuild step (with JetBrains dotCover in our case) fails to discover/execute tests on net48, while the same solution run via a Command Line step (dotnet testwithout dotCover) discovers and runs tests on both target frameworks.Changing the modern TFM to
net8.0-windows(i.e.net48;net8.0-windows) restores correct behavior for both TFMs with the .NET runner.Environment
se.Trimble.PT.ScriptEditor.Testwith<TargetFrameworks>net48;net10.0-windows</TargetFrameworks>VS DotNet PT ScriptEditor.slnSteps to reproduce
<TargetFrameworks>net48;net10.0-windows</TargetFrameworks>and MSTest-based tests.dotnet test "VS DotNet PT ScriptEditor.sln" --configuration Release --no-restore --no-build(plus any filters you use)dotnet testrunner (optionally with dotCover coverage enabled — our failing case uses dotCover wrappingdotnet test)Expected
Both TFMs are discovered and executed; TeamCity reports tests for net48 and net10.0-windows (same as plain
dotnet test).Actual
dotnet test: runs net48 and net10.0-windows successfully.dotnet testvia TeamCity / dotCover): net48 discovery fails; net10.0-windows runs.Evidence (TeamCity build log excerpts)
From the .NET runner step (dotCover +
dotnet test), during the net48 test host session:Build_VS_DotNet_PT_ScriptEditor_1.2.4-alpha-STA-13748-update-se.113.log