开发者

Why can't my project use the NUnit reference?

This is similar to a previous thread I made, but the problem is, I coded something at work, I took the solution home (by copying and pasting it to my usb pen). I pasted it to my desktop at home and when I build one of the projects in the sln (which is depdendent on NUnit), I get a bunch of errors like this:

The type or namespace name 'Framework' does not exist in the namespace 'NUnit' (are you missing an assembl开发者_如何学Pythony reference?)

Basically, any object referenced which is in NUnit is not recognised, as if (obviously) the assembly is missing, but it is not, it is in the project references/bin folder, and there is no yellow exclamation mark. This is a .NET 3.5 solution and I am not using client profile, which can cause this confusion.

Thanks


Try to open your .csproj or .vbproj file with notepad and find something like:

<Reference Include="nunit.framework, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\Program Files\NUnit 2.5.5\bin\net-2.0\framework\nunit.framework.dll</HintPath>
</Reference>

Make sure you have the same version of the DLL and the file path is correct.


Check the hint path for nunit in your .csproj file. It might be hard coded to a different path, make it relative (if the DLL is in your solution), or just grab the right path.

I hope that's your solution!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜