Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

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

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:UsersUsernameDocumentsVisual Studio 2017ProjectsProductAppCoreScraperinDebug
etcoreapp2.0CoreScraper.dll'
   at Microsoft.VisualStudio.TestWindow.Controller.TestContainerProvider.<GetTestContainerAsync>d__61.MoveNext()

"CoreScraper" is the name of the project. When I look in that ... etcoreapp2.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.

question from:https://stackoverflow.com/questions/51256168/running-unit-tests-with-net-core-mstest-the-following-testcontainer-was-not-f

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...