TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

NUnit for MSBuild

Last modified: 20 April 2023

TeamCity provides custom NUnitTeamCity task and NUnit task that is compatible with NUnit task from MSBuild Community tasks project.

The NUnit/NUnitTeamCity task uses the following syntax:

<UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)" />

The NUnit/NUnitTeamCity task tests .NET Assemblies with NUnit. Add the following code to your target in MSBuild script to implement it:

<NUnitTeamCity Assemblies="@(assemblies_to_test)" />

This NUnit task is automatically included in MSBuild and Solution2005 and Solution2008 builds.

The NUnitTeamCity task supports the following extra attributes:

Example usage is shown below (part of the MSBuild build script):