Visual Studio Test Explorer Shows No Tests: Diagnostic and Fix Guide
When Visual Studio’s Test Explorer shows no tests after a clean build, the issue is usually a discovery failure. This guide walks through the most common causes—missing adapters, build configuration, .runsettings filters, and corrupted cache—and shows how to verify and fix each one.
07 Jul 2026, 07:33 UTC

Problem Statement
After a clean build, the Test Explorer pane is empty. The build succeeds, but Visual Studio does not discover any test methods.
Common Causes & Quick Reference Table
| Observed Condition | Likely Cause | First Place to Look |
|---|---|---|
| Test Explorer empty after build | Missing or incompatible test adapter NuGet package | Test project .csproj |
| Tests appear only in one configuration | Test project excluded from the active build configuration | Configuration Manager |
| Tests hidden when a .runsettings file is active | TestCaseFilter or other settings in .runsettings | Active .runsettings file |
| Tests disappear after a Visual Studio update | Corrupted MEF component cache or skipped package state | Component cache folder or package load state |
Step‑by‑Step Checks
1. Confirm the test project builds successfully
Right‑click the test project in Solution Explorer and select Build. Verify that the build output contains bin\Debug\{TargetFramework} (or Release) and that the test assembly exists. If the assembly is missing, the project may be excluded from the active configuration (see step 2).
2. Verify the test project is included in the active build configuration
Open Build > Configuration Manager. Ensure the Build checkbox for the test project is ticked for the active solution configuration (typically Debug). If unchecked, Visual Studio will skip the project during the build, so no assembly is produced for discovery.
3. Check for the correct test adapter NuGet packages
Open the NuGet Package Manager for the test project and confirm that the adapter matching the test framework is present:
- MSTest:
MSTest.TestAdapter+MSTest.TestFramework - xUnit:
xunit.runner.visualstudio+xunit+xunit.core - NUnit:
NUnit3TestAdapter+NUnit
If a required adapter is missing, install it via NuGet, rebuild, and let Visual Studio run discovery again.
4. Validate the target framework is supported by your Visual Studio version
Open the test project .csproj and inspect the <TargetFramework> (or <TargetFrameworks>) element. Visual Studio can discover tests only for frameworks it supports. For example, projects targeting net8.0 require Visual Studio 2022 or newer; older Visual Studio releases do not support .NET 8 test discovery. Check the official Visual Studio release notes to confirm compatibility for your specific version.
5. Inspect the active .runsettings file
A .runsettings file can filter which tests are discovered or executed. Look for a <TestCaseFilter> element; this is the mechanism that excludes tests. The <TestAdapters> element, by contrast, specifies custom adapter assemblies and does not filter tests. To test whether the file is the culprit, rename it (e.g., to temp.runsettings), rebuild, and reopen Test Explorer. If tests appear, the original .runsettings was filtering them. A minimal .runsettings that removes all filters looks like this:
<RunSettings>
<RunConfiguration>
<TargetFramework>net6.0</TargetFramework>
</RunConfiguration>
</RunSettings>
Coordinate any permanent changes with your CI pipeline or team policies, as .runsettings may be shared across environments.
6. Clear the MEF component cache
Corrupted component cache can prevent adapters from loading. Close all Visual Studio instances. In File Explorer, navigate to:
%LocalAppData%\Microsoft\VisualStudio\{Version}\ComponentModelCache
Replace {Version} with the folder that matches your Visual Studio instance (e.g., 17.0_abc123). Delete the entire ComponentModelCache directory. Restart Visual Studio; it will rebuild the cache. This action may temporarily disable installed extensions until the cache is rebuilt.
7. Reset skipped package load state
If Visual Studio has previously marked a test‑related NuGet package as skipped, discovery may remain blocked. Open a Developer Command Prompt for Visual Studio and run:
devenv.exe /resetskippkgs
Run the command under the same user account that normally launches Visual Studio. After the command completes, restart Visual Studio. The first launch may be slower because packages are re‑evaluated.
Verification After Fix
- Rebuild the solution.
- Open Test > Test Explorer and verify that test nodes appear.
- Run a single test method and confirm that the Test Output window shows a successful run.
Escalation Path
- Generate an Activity Log: launch Visual Studio with
devenv.exe /logfrom the Developer Command Prompt, reproduce the issue, and locateActivityLog.xmlin%APPDATA%\Microsoft\VisualStudio\{Version}. - Collect adapter logs: if the test adapter supports diagnostic logging (e.g., via a
--logswitch or an environment variable), capture its output during discovery. - Create a minimal solution that contains only the test project and its adapter. Verify whether discovery works in that isolated context.
- If the problem persists, submit the logs and the minimal reproduction to the Microsoft Developer Community or open a support ticket through the Visual Studio subscription portal.
Limitations
- Assumes SDK‑style test projects; legacy packages.config projects may require additional steps.
- Does not cover custom test runners that replace the default Visual Studio test adapter.
- Clearing the component cache and resetting skipped packages are local IDE repairs; they do not fix missing project references or incompatible target frameworks.
- Adjustments to
.runsettingscan affect CI pipelines; coordinate changes with your build team.
By following the ordered checks above, most common reasons for an empty Test Explorer can be identified and resolved.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.