Skip to content
Latchkey

dotnet test "No test is available" in CI

The runner built the test assembly but the VSTest engine discovered nothing to run. "No test is available" means the test adapter (xUnit, NUnit, MSTest) is missing, or no test methods matched.

What this error means

dotnet test exits non-zero with "No test is available in <assembly>.dll. Make sure that test discoverer and executors are registered and platform and framework version settings are appropriate."

dotnet
No test is available in /app/tests/bin/Release/net8.0/MyApp.Tests.dll.
Make sure that test discoverer and executors are registered and platform and
framework version settings are appropriate, and try again.

Common causes

The test SDK or adapter package is missing

Without Microsoft.NET.Test.Sdk and an adapter (xunit.runner.visualstudio, NUnit3TestAdapter), VSTest cannot discover tests.

No tests matched, or the wrong assembly was run

The project has no [Fact]/[Test] methods, or test was pointed at a non-test assembly.

How to fix it

Add the test SDK and adapter

  1. Reference Microsoft.NET.Test.Sdk and your framework's adapter in the test project.
  2. Restore and rebuild the test project.
  3. Re-run dotnet test.
MyApp.Tests.csproj
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />

Target the correct test project

Point dotnet test at the project that actually contains tests, not a library or the solution's app project.

Terminal
dotnet test tests/MyApp.Tests/MyApp.Tests.csproj

How to prevent it

  • Keep Microsoft.NET.Test.Sdk plus an adapter in every test project.
  • Run dotnet test against the test project or solution explicitly.
  • Confirm test methods carry the framework attributes.

Frequently asked questions

What causes ""No test is available""?
Without Microsoft.NET.Test.Sdk and an adapter (xunit.runner.visualstudio, NUnit3TestAdapter), VSTest cannot discover tests.
How do I fix "No test is available"?
Add the test SDK and adapter

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card