TeamCity 5.0 (10380) NUnitLauncher firing when it shouldnt ..

Hi all,

I should report this to the issue tracker but I want to make sure Im not doing anything wrong first

I have a very simple .NET build configuration .. it uses a MSBuild project and then simply uses the MSBuildCommunity ( Task for NUnit to run a NUnit test (v2.5.2)

     <Target Name="PostBuildTasks" DependsOnTargets="Rebuild">           <NUnit Assemblies="Build\MyTests.dll" ErrorOutputFile="Docs\Error.txt" OutputXmlFile="Docs\Output.xml" ToolPath="Depends\NUnit_252\" />      </Target>

In the build configuration I do not have any NUnit options turned on ( in fact there are none for MSBuild ! ) but my build fails due to the correct version of NUnit not being found by NUnitLauncher.exe ..

[13:32:07]: Project "MyProject.proj.teamcity.patch.tcprojx" (Rebuild target(s)): (18s)
[13:32:24]: NUnit Error: Could not load file or assembly 'nunit.framework, Version=, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified. StackTrace:


Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)    at NUnit.Core.TestRunner.Load(TestPackage package)    at JetBrains.TeamCity.NUnitLauncher.NUnitRunner.LoadTest(String testAssembly, String testName, TestRunner runner) in c:\BuildAgent\work\aed6f5766712ba3f\src\NUnitLauncher\src\NUnit-2.4\NUnitRunner.cs:line 43    at JetBrains.TeamCity.NUnitLauncher.AssemblyTest.LoadTestDomain() in c:\BuildAgent\work\aed6f5766712ba3f\src\NUnitLauncher\src\AssemblyTest.cs:line 71    at JetBrains.TeamCity.NUnitLauncher.LoadTestDomainAction.Action(AssemblyTest test) in c:\BuildAgent\work\aed6f5766712ba3f\src\NUnitLauncher\src\LoadTestDomainAction.cs:line 14    at JetBrains.TeamCity.NUnitLauncher.TryOneAssemblyTest.Action() in c:\BuildAgent\work\aed6f5766712ba3f\src\NUnitLauncher\src\TryOneAssemblyTest.cs:line 18    at JetBrains.TeamCity.NUnitLauncher.TryOneAssembly.Do() in c:\BuildAgent\work\aed6f5766712ba3f\src\NUnitLauncher\src\TryOneAssembly.cs:line 29
[13:32:25]: [Project "MyProject.proj.teamcity.patch.tcprojx" (Rebuild target(s)):] D:\TeamCity_Build\buildAgent\work\4113270fc5966cda\MyProject.proj(247, 3): C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\TeamCity_Build\buildAgent\temp\buildTmp\tmp63E7.tmp exited with code 1.

.. as I have not selected TeamCity to run NUnit I am slightly confused why the NUnitLauncher is running .. (and trying to execute with NUnit-2.4)

I hope this makes sense, please let me know if I've done something stupid in the setup (This happened on the previous build also)
1 comment
Comment actions Permalink

It seems like TeamCity's Unit MSBuild task overwrites the MSBuildComminuty task ..

I found the docs here ( ) but in 5.0 there is a  small gotcha as the NUnitVersion needs to be :

<NUnit Assemblies="Build\MyProject.Tests.dll" NUnitVersion="NUnit-2.5.2" Platform="x86" />

.. and NOT ..

<NUnit Assemblies="Build\MyProject.Tests.dll" NUnitVersion="2.5.2" Platform="x86" />

.. Hope that helps someone .. I think it would be better if the TeamCity Task was renamed so this didnt confuse people in the future.

Please sign in to leave a comment.