在运行NUnit时,获取版本2.0不是兼容版本

时间:2021-10-31 15:41:44

I am trying to run the sample tests for NUnit, and I am getting an error. I have the supportedRuntime versions set to v1.0.3705 up to v2.0.50727. I have the requiredRuntime version set to v2.0.50727. Is this the wrong setting?

我正在尝试为NUnit运行示例测试,我收到了一个错误。我将supportedRuntime版本设置为v1.0.3705,最高为v2.0.50727。我将requiredRuntime版本设置为v2.0.50727。这是错误的设置吗?

The following is the error that shows:

以下是显示的错误:

Metadata file 'c:\Program Files\NUnit 2.4.8\bin\nunit.framework.dll' could not be opened -- 'Version 2.0 is not a compatible version.'

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

1 个解决方案

#1


2  

I got the same problem with the CSharp examples in 2.4.8 "right out of the box" with VS2005. Here's my solution.

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

In nunit.exe.config, the following block is commented-out by default. Put it back in.

在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>

It sounds like you did that but changed the requiredRuntime from the default of v1.0.3705 to v2.0.50727

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

After that, I opened the CSharp project in VS2005 and converted it. The nunit.framework references all had the icon that shows they are wrong. So I deleted the nunit.framework reference from all 4 projects: cs-failures cs-money cs-money-port cs-syntax

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

Then I added new references to C:\Program Files\NUnit 2.4.8\bin\nunit.framework.dll to replace them.

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

After that the project builds fine.

之后,该项目建立良好。

#1


2  

I got the same problem with the CSharp examples in 2.4.8 "right out of the box" with VS2005. Here's my solution.

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

In nunit.exe.config, the following block is commented-out by default. Put it back in.

在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>

It sounds like you did that but changed the requiredRuntime from the default of v1.0.3705 to v2.0.50727

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

After that, I opened the CSharp project in VS2005 and converted it. The nunit.framework references all had the icon that shows they are wrong. So I deleted the nunit.framework reference from all 4 projects: cs-failures cs-money cs-money-port cs-syntax

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

Then I added new references to C:\Program Files\NUnit 2.4.8\bin\nunit.framework.dll to replace them.

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

After that the project builds fine.

之后,该项目建立良好。