Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between vstest.console.exe and dotnet test commands

Is there any difference between vstest.console.exe and dotnet test commands to run unit test from a terminal? Like when should you use one over the other. Is "vstest.console.exe" meant for only .Net framework and "dotnet test" for dotnet core projects? I can't find any specific answer that addresses this on google or in Microsoft's documentation.

The question in the below link comes close but the answer does not address the difference. I want to run my C# project in a build server with a script and was wondering which would be the best option to use.

testing in .net framework

like image 961
cmoe Avatar asked May 24 '26 22:05

cmoe


1 Answers

I believe the vstest.console.exe used to run only MSTests at some point while dotnet test was designed to be more test framework agnostic and support other frameworks like NUnit and xUnit with potential to run them on different platforms (i.e. not only Windows as it was with vstest.console.exe).

According to the official documentation for dotnet vstest:

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

MS also added an important note on that page recently stating that:

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

So it seems like dotnet test is the way now :)

like image 91
Sevenate Avatar answered May 27 '26 17:05

Sevenate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!