【问题标题】:Getting a version 2.0 is not a compatible version when running NUnit运行 NUnit 时获取 2.0 版本不是兼容版本
【发布时间】:2010-02-19 17:11:00
【问题描述】:

我正在尝试为NUnit 运行示例测试,但出现错误。我将 supportedRuntime 版本设置为 v1.0.3705 到 v2.0.50727。我将 requiredRuntime 版本设置为 v2.0.50727。这是错误的设置吗?

以下是显示的错误:

元数据文件“c:\Program Files\NUnit 2.4.8\bin\nunit.framework.dll”无法打开——“2.0 版不是兼容版本。”

【问题讨论】:

    标签: nunit


    【解决方案1】:

    我在 VS2005 的 2.4.8“开箱即用”中的 CSharp 示例中遇到了同样的问题。这是我的解决方案。

    在 nunit.exe.config 中,以下块默认被注释掉。放回去。

      <startup>
      <supportedRuntime version="v2.0.50727" />
      <supportedRuntime version="v2.0.50215" />
      <supportedRuntime version="v2.0.40607" />
      <supportedRuntime version="v1.1.4322" />
      <supportedRuntime version="v1.0.3705" />
    
      <requiredRuntime version="v1.0.3705" />
    
      </startup>
    

    听起来你这样做了,但将 requiredRuntime 从默认的 v1.0.3705 更改为 v2.0.50727

    之后,我在VS2005中打开了CSharp项目并进行了转换。 nunit.framework 引用都有一个图标,表明它们是错误的。所以我从所有 4 个项目中删除了 nunit.framework 引用: cs-失败 cs钱 cs-money-端口 cs语法

    然后我添加了对 C:\Program Files\NUnit 2.4.8\bin\nunit.framework.dll 的新引用来替换它们。

    之后项目构建良好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-29
      • 2022-12-12
      • 1970-01-01
      • 1970-01-01
      • 2019-08-19
      • 2018-07-16
      • 2016-10-12
      • 1970-01-01
      相关资源
      最近更新 更多