Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 4.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.

Table of Contents

NUnit versions support


TeamCity NUnit Test Launcher supports NUnit versions 2.2.10, 2.4.1, 2.4.6, 2.4.7, 2.4.8, and 2.5.0.
TeamCity Addin for NUnit supports only 2.4.6, 2.4.7, 2.4.8, and 2.5.0.
TeamCity 4.5.6+ supports NUnit 2.5.2, and 2.5.3.

TeamCity Addin for NUnit allows you to enable on-the-fly tests reporting from NUnit tests runner when automatic integration is not available.

TeamCity provides Addin that you can plugin into NUnit and the tests will automatically be reported to TeamCity server.

It is highly recommended to get the Addin as a part of you build. This way you may ensure that the addin version is compatible with the TeamCity agent version.

For every build, a path to TeamCity Addin for NUnit is set to the system property teamcity.dotnet.nunitaddin (for MSBuild it would be teamcity_dotnet_nunitaddin).

You need to add the version of NUnit to the end of that path (using NAnt syntax):

  • For NUnit 2.4.X use ${teamcity.dotnet.nunitaddin}-2.4.X.dll (for MSBuild: $(teamcity_dotnet_nunitaddin)-2.4.X.dll)
    Example for NUnit 2.4.7: NAnt: ${teamcity.dotnet.nunitaddin}-2.4.7.dll, MSBuild: $(teamcity_dotnet_nunitaddin)-2.4.7.dll
  • For NUnit 2.5.0 use ${teamcity.dotnet.nunitaddin}-2.5.0.dll (for MSBuild: $(teamcity_dotnet_nunitaddin)-2.5.0.dll)

    It is strongly recommended to copy .dll and .pdb TeamCity Addin for NUnit files every time you run the particular build, because these files could be updated by TeamCity.


    NUnit 2.4.8 has the following known issue: NUnit 2.4.8 runner tries to load assembly according to created AssemblyName object, however, 'addins' folder of NUnit 2.4.8 is not included in application probe paths. Thus NUnit 2.4.8 fails to load any addin in console mode.
    To solve the problem we suggest you to use any of the following workarounds:

    • copy TeamCity addin assembly both to NUnit bin and bin/addins folders
    • patch NUnit-Console.exe.config to include addins to application probe paths. Add the following code into config/runtime element:
      See original blog post on this issue
    To enable on-the-fly test reporting for NUnit, you need to copy TeamCity Addin for NUnit files to the NUnit addin directory. The following example shows how to use NUnit console runner with TeamCity Addin for NUnit 2.4.7 (on MSBuild):

    In TeamCity 4.5, you may need to configure environment variables for NUnit explicitly.
    Specify environment variable with value reference %system.teamcity.dotnet.nunitaddin%.
    See 6.Properties and environment variables for details.