3
votes

I'm having some trouble with getting NUnit to work with MSBuild. I've got http://msbuildtasks.tigris.org/ and the following build file:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <Import Project="3rdparty\MSBuild.Community.Tasks\MSBuild.Community.Tasks.Targets"/>

 <ItemGroup>
   <TestAssembly Include="net.purpletube.minla.test\bin\Debug\*.test.dll" />
 </ItemGroup>

 <PropertyGroup>
   <NUnit-ToolPath>3rdparty\NUnit\</NUnit-ToolPath>
 </PropertyGroup>

 <Target Name="Tests">
   <NUnit Assemblies="@(TestAssembly)" ToolPath="$(NUnit-ToolPath)" />
 </Target>
</Project>

The error I'm getting is:

3rdparty\NUnit\nunit-console.exe /nologo net.purpletube.minla.test\bin\Debug\net.purpletube.minla.test.dll ProcessModel: Default DomainUsage: Single Execution Runtime: Default Could not load file or assembly 'nunit.core, Version=2.5.9.10348, Culture=neu tral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system
cannot find the file specified.

nunit.core is in 3rdparty\NUnit\lib and running nunit-console at the command line on it's own is fine, but if I specify the test assembly I get the error. The following article:

http://nimtug.org/blogs/damien-mcgivern/archive/2006/05/17/Could-not-load-file-or-assembly-nunit-core.aspx

Suggests it may be a problem with my test assembly, but I can't see anything.

Has anyone else seen and solved this?

1

1 Answers

0
votes

Try the Fusion Log Viewer,
http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx It will show you which assemblies are being loaded, or failing to load, as well as the locations it is using to resolve those.

Once you figure out which file it actually fails on, it may provider an additional clue.