Search code examples
c#asp.netazure-devopsazure-pipelinesmstest

unit testing not running in vs but run fine in azure CI pipeline


I have some unit tests made with MSTest, everything was running fine locally in Visual Studio Enterprise 2019 and tests also ran fine in Azure DevOps CI build. I had to change to a new machine today with a freshly installed VS. The problem is no tests will run locally ever since I started working in this new VS environment (the tests still run fine in the CI build).

Can anyone tell me why this is? Am I missing some packages or so? MSTest framework/adapter etc. is installed locally of course

Locally in VS:

6 not run

Azure DevOps CI build:

total tests passed: 6


Solution

  • @craig2020, try to execute this steps:

    Clean the solution.

    Go to top menu Test > Processor Architecture for AnyCPU Project > x64.

    And if you're using git:

    Close the solution and execute git clean -xfd on the solution directory.

    Open VS and try to execute the tests again.