Skip to content

dotnet test (.NET runner / dotCover): net48 tests not discovered when paired with net10.0-windows (MSTest.TestAdapter load fails from wrong TFM output folder) #173

@Perka1000

Description

@Perka1000

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

  1. Create (or use) a test project with <TargetFrameworks>net48;net10.0-windows</TargetFrameworks> and MSTest-based tests.
  2. 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)
    • .NETdotnet test runner (optionally with dotCover coverage enabled — our failing case uses dotCover wrapping dotnet test)
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions