NUnit 3.0 is supported by TeamCity 9.1.x now however you have to install the runner and specify the path to the nunit3.console.exe in the step. My question is where do I copy t
Also building on @NikolayP's answer:
NuGet currently supports the command line argument -ExcludeVersion
for the install
operation. From the docs:
Installs the package to a folder named with only the package name and not the version number.
This results in a path that is rather easy to use in a subsequent NUnit runner build step and allows to drop the clever workaround of @NathanAldenSr.
As of TeamCity 2017.1.3 (and probably earlier versions), this feature is even exposed as a parameter for the NuGet Installer runner (see the Restore Options) but requires a solution path. The example below is suitable for a generic on-the-fly and transient installation of NUnit.
For easy copy and paste (adjust the NUnit version to your requirements):
%teamcity.tool.NuGet.CommandLine.DEFAULT%\tools\nuget.exe
install NUnit.Console -Version 3.7.0 -ExcludeVersion -OutputDirectory %system.teamcity.build.tempDir%\NUnit