我有一個使用NUnit 2.9.3的複雜解決方案(在Windows下開發,部署在GNU \ Linux下)和許多單元測試項目。無法在Mono和Linux下構建NUnit測試項目
下面是從項目的引用:
<Reference Include="nunit.framework, Version=2.9.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files\NUnit 2.9.3\bin\net-4.0\nunit.framework.dll</HintPath>
</Reference>
我從source下載並內置NUnit的2.9.3:
$ xbuild solutions/MonoDevelop/NUnit.Framework.sln /p:Configuration=Release
,並安裝到GAC:
$ gacutil /i solutions/MonoDevelop/bin/Release/nunit.framework.dll
$ gacutil /l nunit.framework
The following assemblies are installed into the GAC:
nunit.framework, Version=2.9.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
Number of items = 1
和刪除本地單聲道nunit安裝:
$ rm /usr/lib/mono/2.0/nunit*
$ rm /usr/lib/mono/4.0/nunit*
,但是當我嘗試建立我的解決方案:
$ xbuild MySolution.sln | grep error
: error CS0006: Metadata file `/usr/lib/mono/2.0/nunit.framework.dll' could not be found
什麼我錯了嗎?
我刪除了`/ usr/lib/pkgconfig/mono-nunit.pc`但是沒有幫助 – abatishchev 2011-02-03 17:20:09
你正在使用哪個版本的mono?嘗試刪除〜〜/ .config/xbuild/pkgconfig-cache-2.xml。如果仍然出現錯誤,則使用「/ v:diag」運行xbuild,它會告訴您爲什麼xbuild會選擇解析nunit引用的特定路徑。 – radical 2011-02-10 11:22:48