似乎我可能会在AppHarbor环境中设置一些环境变量。 我的测试文件夹找不到对nunit框架的引用。我正在使用NUnit 2.5.9。
部分构建输出粘贴在下面。有什么想法我错过了吗?
Primary reference "nunit.framework".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.framework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\temp\oyiirwgf.sjw\input\JeeneeTest\JeeneeTest.csproj]
For SearchPath "{HintPathFromItem}".
Considered "..\..\..\..\..\..\..\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\framework\nunit.framework.dll", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\nunit.framework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\nunit.framework.exe", but it didn't exist.
For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
答案 0 :(得分:3)
我们(AppHarbor)建议您使用NuGet Nunit package。您可以将/packages
文件夹与代码一起提交,也可以使用NuGet package restore使NuGet包作为AppHarbor构建的一部分工作。
答案 1 :(得分:0)
可能您添加了对NUnit的引用,NUnit安装在您的开发PC上(路径指向NUnit安装文件夹:Program Files (x86)\NUnit 2.5.9\bin\net-2.0\framework\nunit.framework.dll
)。有两种方法可以解决这个问题:
nunit.framework.dll
的引用我更喜欢第二个。