dotnet-vstest(1)

πŸ“¦
version 11.0.0~rc3 Β· 6 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– dotnet-vstest β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to dotnet-vstest(1) from the .NET Documentation set. this is the gen-z translation, and I promise every single fact survived the vibe check. 🫢

This article applies to: βœ”οΈ .NET 6 SDK and later versions
🚨 BIG NEWS FIRST, NO CAP: the dotnet vstest command is superseded by dotnet test, which can now be used to run assemblies. See dotnet test. like… it still works, but it's giving "still on the group chat but never replies". πŸ’€

✨ NAME ✨

dotnet-vstest β€” runs tests from the specified assemblies. that's it, that's the whole job, and she does it flawlessly. πŸ’…


🌸 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

look at her. brackets everywhere. main character energy fr. 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

The dotnet vstest command runs the VSTest.Console command-line application to run automated unit tests. so like, it's the little launcher that hands your tests over to the actual test runner. iconic behaviour. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • TEST_FILE_NAMES β€” run tests from the specified assemblies. if you've got more than one test assembly, separate the names with spaces. wildcards are supported, so go feral with the * bestie. πŸ”₯

πŸ’œ OPTIONS πŸ’œ

  • --Blame β€” runs the tests in blame mode. this one is for when a problematic test keeps crashing the test host and you're like "who did this 😭". it creates an output file in the current directory called Sequence.xml that captures the order of test execution before the crash. detective mode: activated. πŸ•΅οΈβ™€οΈ
  • --Diag <PATH_TO_LOG_FILE> β€” enables verbose logs for the test platform. the logs get written to the file you provide. she's chatty and we love that for her. πŸ’¬
  • --Framework <FRAMEWORK> β€” the target .NET Framework version used for test execution. a valid example value is .NETFramework,Version=v7.0. the other supported values are Framework40, Framework45, FrameworkCore10, and FrameworkUap10. pick your fighter. ⭐
  • --InIsolation β€” runs the tests in an isolated process. this makes the vstest.console.exe process less likely to get stopped when a test errors out, but heads up: tests may run slower. safety over speed, that's the tradeoff, periodt. 🐒
  • -lt|--ListTests <FILE_NAME> β€” lists all discovered tests from the given test container. no running, just ✨ manifesting ✨ a list of what's in there.
  • --logger <LOGGER_URI/FRIENDLY_NAME> β€” specify a logger for test results. two flavours, both slay:
    • to publish test results to Team Foundation Server, use the TfsPublisher logger provider:
/logger:TfsPublisher;
    Collection=<team project collection url>;
    BuildName=<build name>;
    TeamProject=<team project name>
    [;Platform=<Defaults to "Any CPU">]
    [;Flavor=<Defaults to "Debug">]
    [;RunTitle=<title>]
  • to log results to a Visual Studio Test Results File (TRX), use the trx logger provider. this switch creates a file in the test results directory with the given log file name. if LogFileName isn't provided, a unique file name is created to hold the test results. she'll name herself, don't worry. πŸ’–
/logger:trx [;LogFileName=<Defaults to unique file name>]
  • --Parallel β€” run tests in parallel. by default, all available cores on the machine are available for use. wanna specify an explicit number of cores? set the MaxCpuCount property under the RunConfiguration node in the runsettings file. multitasking queen. πŸ‘‘
  • --ParentProcessId <PROCESS_ID> β€” the process ID of the parent process responsible for launching the current process. family tree, but make it PIDs. 🌳
  • --Platform <PLATFORM_TYPE> β€” the target platform architecture used for test execution. valid values are x86, x64, and ARM. choose wisely bestie. 🎯
  • --Port <PORT> β€” specifies the port for the socket connection and for receiving the event messages. πŸ“‘
  • --ResultsDirectory:<PATH> β€” the test results directory will be created in the specified path if it doesn't already exist. she builds her own home. 🏠
  • --Settings <SETTINGS_FILE> β€” the settings to use when running tests. πŸ“
  • --TestAdapterPath <PATH> β€” use custom test adapters from a given path (if any) in the test run. bring your own adapter, we stan. 🧚
  • --TestCaseFilter <EXPRESSION> β€” run tests that match the given expression. <EXPRESSION> is of the format <property>Operator<value>[|&<EXPRESSION>], where Operator is one of =, !=, or ~. the ~ operator has contains semantics and is applicable for string properties like DisplayName. parentheses () are used to group subexpressions. for more information, see TestCase filter (https://github.com/Microsoft/vstest-docs/blob/main/docs/filter.md). filtering is self-care. πŸ’…
  • --Tests <TEST_NAMES> β€” run tests with names that match the provided values. separate multiple values with commas. cherry-picking, but legal. πŸ“
  • -?|--Help β€” prints out a short help for the command. when in doubt, ask. πŸ™ˆ
  • @<file> β€” reads a response file for more options. options, but make it a file. πŸ“‚
  • args β€” specifies extra arguments to pass to the adapter. arguments are specified as name-value pairs of the form <n>=<v>, where <n> is the argument name and <v> is the argument value. use a space to separate multiple arguments. 🌈

πŸ”₯ EXAMPLES πŸ”₯

run tests in mytestproject.dll:

dotnet vstest mytestproject.dll

run tests in mytestproject.dll, exporting to a custom folder with a 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 🌟

  • VSTest.Console.exe command-line options β€” go read it, iykyk. πŸ’–

that's the whole page bestie, no skips, no shortcuts, every flag accounted for. πŸŽ€

sign-off time: this was dotnet-vstest(1) from the .NET Documentation set, dated 2025-10-30. go run your tests, they're gonna eat. πŸ«Άβœ¨πŸ’œ

πŸ“¦ where this page comes from