Dotnet Test ProviderA lightweight .NET test experience for VS Code's built-in Testing view. Dotnet Test Provider discovers .NET test projects in a trusted local workspace, presents their tests in VS Code's Testing view, and runs them through the project's own test tooling. Run a method while editing, a project before committing, or the entire workspace when you need the full picture—without maintaining custom tasks or leaving the editor. It is designed for teams that want VS Code's native test UI while working across modern SDK-style projects and older .NET codebases. What you get
The extension uses runner-provided discovery and result artifacts when they are available. Its C# source fallback keeps some older projects visible, but it does not pretend source parsing is equivalent to a test runner. Supported project styles
Support is determined per project. The Testing view shows each project's support tier and runner mode so degraded behavior is visible rather than hidden. Important limits
Get started
The extension executes workspace-controlled MSBuild and test logic, so it is unavailable in Restricted Mode and virtual workspaces. If discovery needs a clean reset, run Dotnet Test Provider: Rebuild Discovered Tests from Scratch from the Command Palette or the Testing view menu. Discovery results are cached in VS Code workspace state and restored immediately on startup. The cached tests remain available while tracked project, source, and configuration inputs are checked in the background; changed projects are refreshed as they finish, or a workspace refresh is scheduled when the project inventory or configuration changes. The output channel reports cache reuse and refresh decisions. A different VS Code profile or Extension Development Host can have separate workspace storage; see troubleshooting for the cache boundaries. File watcher events are debounced and checked against the last discovery fingerprints before starting another scan. Events that leave tracked inputs unchanged, such as notifications from Git activity, do not by themselves trigger discovery. An explicit refresh still runs discovery. Background discovery has a two-minute deadline. When it expires, the extension cancels active discovery and retains the existing test tree instead of replacing it with a partial refresh. Check the Dotnet Test Provider output channel for timeout details. While the Testing tree is empty, the Testing view shows when Dotnet Test Provider is scanning, whether the scan finished without finding projects, or whether discovery could not complete. The message links to the provider's output and offers another scan when appropriate. Once test-project candidates are identified, a temporary Discovery group in the Testing tree shows each project's waiting, preparation, scanning, scanned, or failed state. It uses a separate discovery-only controller without run or debug profiles; the group is removed shortly after the scan. Interrupted scans retain the existing discovered test tree. The Testing tree shows discovered test counts, and a run queues its discovered selection before building. The run summary retains that starting count. VSTest case identities are counted individually when available; source and console fallbacks count discovered method nodes. Runners can discover dynamic or parameterized cases only at execution time, so their reported result count can differ from the starting count. The VS Code Testing view counts its test items, which can also differ from the runner's case count. During test runs, coverage, and debugging, the status bar shows the overall phase and the project or solution when known. Project descriptions in the Testing tree show each selected project's own phase, including waiting, building, built, running and completion, alongside the discovered test count. A shared solution build marks its selected member projects together; after a failed solution build, projects return to waiting while individual builds are attempted. While running and on successful completion, the status bar also shows reported results against the discovered total. Cancellation remains visible until cleanup finishes; the final status is shown briefly. VS Code's built-in Testing progress indicator cannot be extended with custom phase text. VS Code's Fit it into your workflowMost projects work without configuration. Select the Testing view's Coverage profile to run VSTest projects with the bundled Coverlet collector; results appear as line, branch, and method coverage in VS Code. The extension restores the latest coverage automatically when its source files have not changed; use Dotnet Test Provider: Toggle Cached Coverage to disable that behavior. When projects need customization, configure extra Use the editor context menu or Command Palette for Run Tests in Context, Debug Tests in Context, Run Test Target, Debug Test Target, Go to Test Source, and Show Output. The output channel records the runner invocation and explains degraded results, unavailable coverage, or split execution batches. For compatible VS Code chat agents, reference tools such as Learn more |