【问题标题】:NUnit - "Test load failed System.ApplicationException: Unable to find test in assembly"NUnit - “测试加载失败 System.ApplicationException:无法在程序集中找到测试”
【发布时间】:2019-07-03 23:45:24
【问题描述】:

我正在使用 NUnit 2.6.3 和 .NET 框架 4.5。

我的测试项目中有一个文件 Test.NUnit,其中包含:

<NUnitProject>
<Settings activeconfig="Debug"
         appbase="E:\Test" />
 <Config name="Debug" binpathtype="Auto">
   <assembly path="bin\Debug\Test.dll" />
 </Config>
 <Config name="Release" binpathtype="Auto" />
 </NUnitProject>

当我尝试运行此文件时,我收到一条错误消息

测试加载失败 System.ApplicationException: 无法在程序集中找到测试

问题类似于this question。但是,我无法得到工作的答案。

我的项目中有一个 Test.dll.config 文件,它位于 E:\Test。

它包含:

 <startup useLegacyV2RuntimeActivationPolicy="true">
      <!--<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />>-->
      <supportedRuntime version="v4.0.30319" />
    </startup>

我已经尝试了两个版本的 supportedRuntime 以表明我正在使用 .NET framework 4.5。

【问题讨论】:

    标签: nunit


    【解决方案1】:

    我遇到了类似的问题。检查您的防火墙阻止 nunit-agent.exe 尝试连接 127.0.0.1。

    NUnit 使用它来运行测试,如果它无法连接到 127.0.0.1,则不会显示正确的错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-23
      • 2013-06-18
      • 1970-01-01
      • 2012-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多