首页 > 解决方案 > 使用 .NET Core MSTest 运行单元测试:“未找到以下 TestContainer...”

问题描述

我搜索了高低,找不到这个异常的答案。这个问题是我搜索时出现的主要问题,但它没有解决这个问题。

[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”是项目的名称。当我查看该...\netcoreapp2.0\文件夹时,CoreScraper.dll 肯定在其中。我通过右键单击测试方法并选择“运行测试”来运行测试。我第一次运行它时测试运行良好,但从那以后它就给了我这个错误。我已经关闭了 Visual Studio 并重新打开,删除了 的内容bin\,清理并重建了项目等。

标签: c#selenium-webdrivermstestasp.net-core-2.1

解决方案


什么对我有用:

删除文件夹内的.vs文件夹。

但是您仍然无法删除该文件夹?

可能是因为Live Unit Testingtesthost.exe或者testhost.x86.exe过程是原因。


推荐阅读