Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Dotnet Test ProviderNew to Visual Studio Code? Get it now.
Dotnet Test Provider

Dotnet Test Provider

MiJur

|
38 installs
| (0) | Free
Discover and run .NET tests in VS Code's built-in Testing view.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dotnet Test Provider

A 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

  • Automatic discovery of supported test projects when a workspace opens, with manual refresh when needed.
  • A navigable test tree organized by project, namespace, class, and method.
  • Run controls for the Testing view at the test, class, namespace, project, saved-group, or workspace level, with debugging where the runner supports it.
  • Coverage in the Testing view for VSTest projects, including line, branch, and method coverage from the bundled Coverlet collector—no project package change required.
  • Results where you work: passed, failed, skipped, errored, and inconclusive outcomes appear in the Testing view with runner messages and stack traces when available.
  • Source navigation from tests and failure messages back to C# declarations.
  • Run groups for recurring cross-project or focused test selections. Expand a group to inspect its saved targets; use its context menu to rename or delete it, or a saved target's context menu to remove that target.
  • Runner-aware execution that reuses builds inside a logical multi-target run when it is safe to do so.
  • Structured agent tools for compatible VS Code chat agents: find tests, run stable selections, inspect results, and rerun failures.

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

Project style Discovery Run Debug
SDK-style VSTest Yes Yes Yes
Native Microsoft.Testing.Platform (MTP) Yes Yes When the project exposes direct executable debugging
MTP compatibility bridge Yes Yes No
Classic non-SDK .NET Framework Best-effort: built assembly or C# source fallback Not currently supported No

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

  • A theory or data-driven selection can run the normalized method, which may execute every data row rather than one row.
  • Source-only discovery for legacy projects can miss adapter-specific names or structure.
  • If artifact or protocol results are unavailable, the extension falls back to console parsing; those results are marked degraded and can be less reliable.
  • Debugging requires the Microsoft C# extension or C# Dev Kit and a debugger compatible with the target framework.
  • Coverage runs require VSTest. Native MTP and MTP compatibility projects can run tests but cannot currently produce the Coverlet report required by VS Code's Coverage profile.

Get started

  1. Install a .NET SDK and ensure dotnet is on PATH.
  2. Install Dotnet Test Provider in VS Code.
  3. Open a trusted local workspace containing .NET test projects.
  4. Open the Testing view. Discovery begins automatically.
  5. Use the standard Run or Debug controls on a test, scope, project, or saved group.

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 testing.followRunningTest setting controls whether it reveals running tests and expands their branches.

Fit it into your workflow

Most 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 dotnet test arguments, a .runsettings file, VSTest or MTP diagnostics, preserved TRX artifacts, native MTP behavior, and saved test run groups.

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 #findDotnetTests, #runDotnetTests, #getDotnetTestResults, and #runFailedDotnetTests. Agent runs update the same Testing view as interactive runs. An optional loopback-only MCP server can expose the same tools to external clients; see the configuration reference for its security settings.

Learn more

  • Configuration reference
  • Troubleshooting
  • Architecture and runtime flows
  • MIT License
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft