NUnit Teamcity launcher log4net problem


I'm evaluating TeamCity for my company, and I'm also new to MSBuild (i.e. I've got about one day's experience :)).

In my MSBuild file I've got the following:

<TestAssemblies Include="$(TestsDir)\*\.Tests.exe" />

Is it possible to specify the .nunit file that has a list of the test assemblies, rather than specifying them as an item group? If that's the case, I can get rid of the TestAssemblies ItemGroup.

Currently my build is failing (silently) because the NUnit launcher seems to die. I get the following message in my log file:

Using "NUnit" task from assembly "C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll".
C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\TeamCity\buildAgent\temp\buildTmp\tmp42D.tmp
The "NUnit" task is using "C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe" from "C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe".
Failed to initialize log4net Process performance counter is disabled, so the requested operation cannot be performed.
at System.Diagnostics.NtProcessManager.GetProcessInfos(PerformanceCounterLib library)
at System.Diagnostics.NtProcessManager.GetProcessInfos(String machineName, Boolean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos(String machineName)
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_StartTime()
at JetBrains.TeamCity.Utils.Log.Log4NetConfigurator..ctor()
Process exit code: 0

Does anyone know what's going wrong here? Also, why doesn't the build fail when this happens (i.e. why is the exit code 0)? I can run nunit using an exec statement fine, but obviously that's a pain because it doesn't integrate with TeamCity.



Please, try enabling performance counters.

Try to reenable the appropriate performance counter by opening
in the registry and removing an entry named "Disable Performance Counters".

More information can be found at:;EN-US;q249138;en-us;Q248993

BTW. Was those counters be disabled intentionally.



I have checked the message. This message should be treated as warning. It does not crashed your process.


.nunit is not supported by NUnit runner, but, it is possible to get TeamCity plugin for NUnit-2.4.7 runner.

Please try coping a files $(teamcity_dotnet_nunitaddin)-2.4.7.* to NUnit 2.4.7 addin folder. After that running nunit-console will send all necessary on-the-fly test information to TeamCity server.

BTW. It is strongly recommended to copy this .dll and .pdb plugin file any time on the build because the dll and .pdb file may be changed by upgrading or by path of TeamCity.


Thanks for the replies. I've tried both of your suggestions, and neither of them work. I looked in the registry at the location you specified, and I can't find the key you talked about. I tried following the steps in the Microsoft support page link you gave me, but from what I can see, I don't have any disabled performance counters.

I tried to copy the NUnit addin like you suggested, but the $(teamcity_dotnet_nunitaddin) variable doesn't appear to have been set. Do I need a specific version of TeamCity for this (I have TeamCity Professional 3.1.1 build 6828). The relevant part of my build file is as follows:




Here's an update.

I followed the instructions in the final post from (i.e. copying the .dat files into system32) and I no-longer get the error message in my build log. I've successfully managed to run my tests using the NUnit MSBuild task now. The only annoying thing about this is having to specify the list of assemblies rather than being able to specify the nunit file. I tried using an ItemGroup with wildcard statements, but that didn't seem to work - could just be my inexperience with MSBuild. Anyhow, worst case scenario, I can write a simple task or something that parses the nunit file and forwards it on to the TeamCity nunit task.

Thanks for the help anyway. I suspect the root of my problems is the fact that the box I've installed TC on is a VM that's a copy of another VM. I think I'll set it up on a completely clean machine from scratch before we go into production.



Please sign in to leave a comment.