You are viewing the documentation of TeamCity 9.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.


Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: related to https://youtrack.jetbrains.com/issue/TW-50854

TeamCity provides its own NUnit tests launcher that can be used from command line. The tests are run according to the passed parameters and, if the process is run inside the TeamCity build agent environment, the results are reported to the TeamCity agent.


Supported NUnit versions: For NUnit 3.x, use the NUnit build runner since TeamCity 9.1.
It is possible to have several versions of NUnit installed on an agent machine and use any of them in a build.

  • If you need to access the path to the TeamCity NUnit launcher from some process, you can add the %system.teamcity.dotnet.nunitlauncher% environment variable.
  • Values surrounded with "%" within custom scripts in the Commandline runner are treated as TeamCity references.

You can pass the following command line options to the TeamCity NUnit Test Launcher:

Code Block

${teamcity.dotnet.nunitlauncher} <.NET Framework> <platform> <NUnit vers.> [/category-include:<list>] [/category-exclude:<list>] [/addin:<list>] <assemblies to test>



<.NET Framework>

Version of .NET Framework to run tests. Acceptable values are v1.1, v2.0, v4.0 or ANY.


Platform to run tests. Acceptable values are x86, x64 and MSIL.


For .NET Framework 1.1 only MSIL option is available.

<NUnit vers.>

Test framework to use. The value has to be specified in the following format: NUnit-<version>.

Excerpt Include
NUnit Support
NUnit Support
nopaneltrueNUnit Support


The list of categories separated by ';' (optional).


The list of categories separated by ';' (optional).


List of third-party NUnit addins to use (optional).

<assemblies to test>

List of assemblies paths separated by ';' or space.


Specify, if you want to run each assembly in a new process.


Run tests from an assembly:

Code Block

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.2.10 Assembly.dll

Run tests from an assembly with NUnit categories filter

Code Block

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.2.10 /category-include:C1 /category-exclude:C2 Assembly.dll

Run tests from assemblies:

Code Block

%teamcity.dotnet.nunitlauncher% v2.0 x64 NUnit-2.5.0 /addin:Addin1.dll;Addin2.dll Assembly.dll Assebly2.dll