dotnet-vstest - Man Page

Runs tests from the specified assemblies.

dotnet vstest

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

The dotnet vstest command is superseded by dotnet test, which can now be used to run assemblies. See dotnet test.

Synopsis

dotnet vstest [<TEST_FILE_NAMES>] [--Blame] [--Diag <PATH_TO_LOG_FILE>]
    [--Framework <FRAMEWORK>] [--InIsolation] [-lt|--ListTests <FILE_NAME>]
    [--logger <LOGGER_URI/FRIENDLY_NAME>] [--Parallel]
    [--ParentProcessId <PROCESS_ID>] [--Platform] <PLATFORM_TYPE>
    [--Port <PORT>] [--ResultsDirectory<PATH>] [--Settings <SETTINGS_FILE>]
    [--TestAdapterPath <PATH>] [--TestCaseFilter <EXPRESSION>]
    [--Tests <TEST_NAMES>] [[--] <args>...]]

dotnet vstest -?|--Help

Description

The dotnet vstest command runs the VSTest.Console command-line application to run automated unit tests.

Arguments

Options

Examples

Run tests in mytestproject.dll:

dotnet vstest mytestproject.dll

Run tests in mytestproject.dll, exporting to custom folder with custom name:

dotnet vstest mytestproject.dll --logger:"trx;LogFileName=custom_file_name.trx" --ResultsDirectory:custom/file/path

Run tests in mytestproject.dll and myothertestproject.exe:

dotnet vstest mytestproject.dll myothertestproject.exe

Run TestMethod1 tests:

dotnet vstest /Tests:TestMethod1

Run TestMethod1 and TestMethod2 tests:

dotnet vstest /Tests:TestMethod1,TestMethod2

See Also

Info

2024-10-02 .NET Documentation