c# - 使用 .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\
,清理并重建了项目等。
解决方案
什么对我有用:
删除文件夹内的.vs
文件夹。
但是您仍然无法删除该文件夹?
可能是因为Live Unit Testing,testhost.exe
或者testhost.x86.exe
过程是原因。
推荐阅读
- xslt - XSL 中的替换功能问题
- c# - 你可以在 Xamarin.Forms 中使用 Firebase.Auth 吗?
- python - 将行转置为python列
- android - Kotlin Android 扩展:java.lang.IllegalStateException:视图不能为空
- buffer - Vulkan,多个对象的相同统一缓冲区?
- nativescript - Nativescript - Android TabView 后退按钮自定义导航
- javascript - React-Redux - 在组件中的另一个请求中使用来自 componentDidMount 中的获取请求的响应
- clojure - 拆分字符串时clojure java.lang.NullPointerException
- node.js - Nodejs识别客户端ssl
- ios - 如何将可映射对象保存到 nsuserdefault?