运行 NUnit 时出现 FileNotFoundException

发布于 2024-10-26 07:18:29 字数 825 浏览 0 评论 0原文

我在通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城之時有危險 2024-11-02 07:18:29

当我有这个时,它是 v2.5.10 的。我发现我实际上也没有在依赖项文件夹中引用 nunit.core.interfaces.dll 。

我最终得到了 3 个引用:

  • unuit.core.dll
  • nunit.core.interfaces.dll
  • nunit.framework.dll

希望这可能有所帮助。

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:

  • unuit.core.dll
  • nunit.core.interfaces.dll
  • nunit.framework.dll

hope this might help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文