运行 NUnit 时出现 FileNotFoundException
我在通过 Resharper 在 Visual Studio 中运行一些测试时遇到了 FileNotFoundException。所以我决定回去检查 NUnit GUI 的运行情况。我尝试的第一件事是确保一切正常工作并运行 NUnit 安装附带的 NUnit 测试 (NunitTests.nunit)。
大多数都通过了,但也有不少测试失败了。看来主要有两个失败:
NUnit.Util.Tests.ProcessRunnerTests.BasicRunnerTests.CountTestCases: System.ArgumentException:未安装 CLR 版本 2.0.50727.3615 的 NUnit 组件 参数名称:targetRuntime
和
NUnit.Util.Tests.RemoteTestResultTest.ResultStillValidAfterDomainUnload: System.IO.FileNotFoundException:无法加载文件或程序集“nunit.core.interfaces,Version=2.5.9.10348,Culture=neutral,PublicKeyToken=96d09a1eb7f44a77”或其依赖项之一。系统找不到指定的文件。
这是使用 msi 安装的 NUnit 2.5.9,并且 nunit.core.interfaces.dll 确实存在。我将其位置添加到系统路径中,但这没有帮助。
是否还需要配置其他内容才能使 NUnit 正常工作?不确定我原来的问题是否与此相关,但似乎我至少需要首先让这些基线测试发挥作用。
I encountered a FileNotFoundException when running some tests in Visual Studio via Resharper. So I decided to go back and check running the NUnit GUI. The first thing I tried was to make sure everything was working properly and ran the NUnit tests that came with the NUnit install (NunitTests.nunit).
Most passed, but there were quite a few tests that failed. There appears to be two main failures:
NUnit.Util.Tests.ProcessRunnerTests.BasicRunnerTests.CountTestCases:
System.ArgumentException : NUnit components for version 2.0.50727.3615 of the CLR are not installed
Parameter name: targetRuntime
and
NUnit.Util.Tests.RemoteTestResultTest.ResultStillValidAfterDomainUnload:
System.IO.FileNotFoundException : Could not load file or assembly 'nunit.core.interfaces, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified.
This is NUnit 2.5.9 installed using the msi and the nunit.core.interfaces.dll does exist. I added it's location to the system path but that didn't help.
Is there something else that needs to be configured for NUnit to work properly? Not sure if my original problem is related to this, but it seems like I need to at least get these baseline tests to work first.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我有这个时,它是 v2.5.10 的。我发现我实际上也没有在依赖项文件夹中引用 nunit.core.interfaces.dll 。
我最终得到了 3 个引用:
希望这可能有所帮助。
When I had this it was for v2.5.10. I found that I had not actually referenced nunit.core.interfaces.dll in my dependencies folder as well.
I ended up having 3 references:
hope this might help.