Skip to content
Latchkey

"dotnet test: No test is available" in CI

VSTest ran but discovered zero tests because the project is missing the discovery/execution plumbing - typically the Microsoft.NET.Test.Sdk package and a framework adapter (xUnit/NUnit/MSTest). Without these, there is nothing to register and no tests are found.

What this error means

The dotnet test step warns "No test is available" and tells you to ensure test discoverers and executors are registered. The run "passes" with zero tests, which can silently hide a broken suite.

dotnet
No test is available in /repo/bin/Debug/net8.0/Tests.dll. Make sure that test discoverer
& executors are registered and platform & framework version settings are appropriate.

Common causes

Missing Microsoft.NET.Test.Sdk

Without the test SDK package, the project does not produce a testable assembly with the VSTest entry point.

Missing the framework test adapter

The xUnit/NUnit/MSTest adapter package is absent, so the discoverer for that framework is not registered.

How to fix it

Add the test SDK and adapter packages

  1. Reference Microsoft.NET.Test.Sdk plus your framework's adapter and core packages.
  2. Restore and re-run dotnet test.
.csproj
<ItemGroup>
  <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
  <PackageReference Include="xunit" Version="2.9.2" />
  <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

Test the right assembly/TFM

  1. Point dotnet test at the test project/solution, not a library.
  2. Ensure the test project's TFM matches the installed runtime.
  3. Re-run.

How to prevent it

  • Keep Microsoft.NET.Test.Sdk and an adapter in every test project.
  • Fail CI when the discovered test count is zero to avoid silent passes.
  • Restore before test so the adapters are present.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →