Questions tagged [vstest.console.exe]
102 questions
4
votes
1 answer
Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll' from Unit Tests when using Microsoft.Data.SqlClient 2.0
When using the Microsoft.Data.SqlClient package (version 2.0) in my code I get the following error when Unit Tests are executed via VSTest.console.exe in our CI provider (and when ran locally):
System.TypeInitializationException: The type…

Chris
- 3,081
- 3
- 32
- 37
4
votes
1 answer
NUnit tests are not restarted through VSTest in DevOps
I am using VSTest to run tests via Azure DevOps. Tests run successfully, but using the option rerun failed tests: true, an error appears during the restart phase.
NUnit 3.12.0 ;
NUnit Adapter 3.16.1.0 (Checked with 4.0.0.0)
vstest.console.exe…

almazmr
- 41
- 2
4
votes
1 answer
How to handle Multiple TestCategory under TestCaseFilter
I am trying to Call one out of 3 TestCategory in my code
Test Categories are:-
[TestCategory("SystemOne"), TestCategory("FunctionalTest"), TestCategory("RegressionTest"), TestCategory("Sanity")
The VSTest code for calling the Test Category…

VikinLoop
- 41
- 5
4
votes
1 answer
TFS 2017 test task run fails on VS 2017 build machine if code coverage is enabled
We're executing a number of tests on a build machine with VS 2017 Enterprise where we've enabled code coverage on the Visual Studio test task. This fails with the following error in the TFS 2017 console:
##[section]Starting: Test Assemblies…

llykke
- 253
- 2
- 14
4
votes
1 answer
Coded UI Automated Test Case through Octopus Tentacle
I am trying to run my Automated test cases deployed on a virtual machine and trying to trigger it with the help of Octopus Deployment tool. I installed test agent and Octopus Tentacle on my machine. Octopus is triggering the DLL's for Automated test…

Shian JA
- 848
- 4
- 15
- 52
3
votes
0 answers
Does OpenCover run tests in parallel? Is there an option to have it not?
I'm having some issues running OpenCover.console over some .NET assemblies.
We're seeing some MSTEST tests fail, only when run under OpenCover.
What's going on is that we have certain of our tests that are reading and writing to a LocalDB database.…

Jeff Dege
- 11,190
- 22
- 96
- 165
3
votes
0 answers
TfsPublisher logger for dotnet vstest
When we use
"dotnet vstest "Mytest.dll" /logger:TfsPublisher;Collection="";BuildName="";TeamProject="";Platform="AnyCPU";Flavor="Release";
We get the following error:
Could not find a test logger with…

domueni
- 304
- 8
- 19
3
votes
0 answers
Filter uncategorized tests in vstest.console.exe
I have a visual studio test assembly. There are several test methods of which a few methods have TestCategoryAttribute on them and others don't. I want to filter out all the methods that do not contain the attribute from getting executed, i.e,…

Kannan D
- 467
- 1
- 4
- 15
3
votes
1 answer
vstest.console.exe runs same tests multiple times
This is the command I use to run all NUnit tests from specified library
vstest.console.exe "PATH_TO_REPOSITORY\Tests\terminalBaseTests\bin\debug\terminalBaseTests.dll" /logger:trx /TestAdapterPath:"PATH_TO_REPOSITORY"
This dll contains 27 tests but…

Demarsch
- 1,419
- 19
- 39
3
votes
1 answer
VSTest.console Filter native c++ unit tests by attribute
I'm currently running into the following problem:
We introduced Unit-Tests into our native c++ application by using the native microsoft unit test framework included in Visual Studio 2015 Microsoft::VisualStudio::CppUnitTestFramework.
To start the…

LorToso
- 286
- 1
- 9
3
votes
1 answer
Running tests based on a namespace using vstest.console using
I have been using MsTest.exe to run tests using the namespace like this:
mstest.exe /testcontainer:"MyDllFile.dll" /test:"NameSpace.Folder.Folder1.*"
This worked like a charm but I needed to be able to pass parameters at runtime to my tests, so I…

Alejandro Taylor
- 65
- 2
- 8
3
votes
0 answers
Run generic NUnit tests from command line of VS2015 SP1
Problem: after installing SP1 for Visual Studio 2015 i cannot execute generic test from command line.
My command line and output is the next:
"C:\Program Files (x86)\Microsoft Visual Studio …

Vasil
- 31
- 4
2
votes
0 answers
vsTest.Console.exe does not respect MaxCpuCount and it always uses all available cores
I want to limit the amount of parallelism for running a large number of tests in parallel.
I have over 100 test dlls that I want to run and I would like to limit the number that run in parallel so that it does not consume all my cpu and memory…

Kevin Ernst
- 21
- 1
2
votes
0 answers
What causes vstest to hang after executing all tests successfully
We are using the Visual Studio test framework and C# to write unit tests, and we recently ran into a problem where vstest.console.exe sometimes hangs after executing all the tests. All tests pass, but then vstest.console.exe just sits there forever…

Wim Coenen
- 66,094
- 13
- 157
- 251
2
votes
1 answer
Why test assemblies are not filtering in VSTS azure build pipeline despite putting test assembly patterns?
Here is my test assembly patterns (configuration)
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
!**\$(BuildConfiguration)\*Integration*
After triggering build, here is the log where integration test assembly is also there (this file must be…

Deepak
- 1,510
- 1
- 14
- 27