Running unit tests with .NET Core MSTest: "The following TestContainer was not found..."

What worked for me:

Delete folders inside .vs folder.

But you still can't delete that folder ?

Probably because of Live Unit Testing, testhost.exe or testhost.x86.exe process is the cause.


The problem was that the NuGet package Microsoft.NET.Test.Sdk was not installed. Installing this package in the project via the NuGet Package Manager solved the problem.

This wasn't intuitive to me since I have another unit test project that runs fine without the Microsoft.NET.Test.Sdk package, but that project is .NET Framework 4.6.2.


Today I faced similar issue with Visual Studio 2017 for xUnit Tests. My Observations:

  1. Issue arise for me when switching between Release/Debug mode.
  2. Solution: Restart Visual Studio and it resolved the issue.

Note After some Google/Bing, I discovered everyone got the solution by installing some packages. However in my case everything was working before and hence decided not to install anything additional.

Hope it helps.