I've searched high and low and can't find answer to this Exception. This question is the main one to come up when I search, but it doesn't address this issue.
[7/8/2018 6:22:22 PM Informational] Executing test method 'CoreScraper.FlyerScraper.GetAllCurrentFlyers'
[7/8/2018 6:22:22 PM Error] System.InvalidOperationException: The following TestContainer was not found 'C:\Users\Username\Documents\Visual Studio 2017\Projects\ProductApp\CoreScraper\bin\Debug\netcoreapp2.0\CoreScraper.dll'
at Microsoft.VisualStudio.TestWindow.Controller.TestContainerProvider.<GetTestContainerAsync>d__61.MoveNext()
"CoreScraper" is the name of the project. When I look in that ...\netcoreapp2.0\
folder, the CoreScraper.dll is definitely in there. I am running the test by right-clicking in the test method and selecting "Run Tests". The test ran fine the very first time I ran it, but it has given me this error ever since. I've closed out of Visual Studio and reopened, deleted the contents of bin\
, cleaned and rebuilt the project, etc.
In this article, I will explain about the unit test in asp.net core using MSTest. There are three different test frameworks which are supported by the unit test with asp.net core: MSTest, xUnit, and NUnit, which allow us to test our code in a consistent way.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With