Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

dotnet test

Feedback

In this article

This article applies to: ✔️ .NET 6 SDK and later versions

Name

dotnet test - .NET test driver used to execute unit tests.

Description

Thedotnet test command builds the solution and runs the tests with either VSTest or Microsoft Testing Platform (MTP). The test runner you use determines the available command-line options and behavior.

Note

Test runner selection is available starting with .NET 10 SDK. In earlier versions of .NET, tests are always executed with VSTest.

Choosing a test runner

To enable Microsoft.Testing.Platform, you need to specify the test runner in theglobal.json file:

{    "test": {        "runner": "Microsoft.Testing.Platform"    }}

Note

VSTest is a valid value for test runner. It is the current default and can be omitted.

Important

Thedotnet test experience for MTP is only supported inMicrosoft.Testing.Platform version 1.7 and later.

Test runner documentation

The available command-line options, behavior, and capabilities differ depending on which test runner you use:

  • dotnet test with VSTest - The traditional test platform, available in .NET 6 SDK and later. This is the default and only test runner in versions earlier than .NET 10 SDK. Provides comprehensive test discovery, filtering, and result reporting capabilities.

  • dotnet test with MTP - The modern testing platform, available in .NET 10 SDK and later. Offers faster test execution and more flexible test module selection.

Tip

For conceptual documentation aboutdotnet test, seeTesting with dotnet test.

See also

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?