1

I am beginner for TeamCity. And I have successfully setup TeamCity to build a Hello World ASP.NET MVC project. But once I added a NUnit test project in the solution, TeamCity always complains: NUnit relevant references are missing(which I absolutely don't miss them in the code) see following screenshot:

enter image description here

My NUnit project is very simple. Just one class:

enter image description here

And the TeamCity error is:

enter image description here

My configuration in TeamCity is very simple. I have just one Build Step using MsBuild: enter image description here

I have tried to use MsBuild locally to run the project. It works well.

So what could be the problem of buiding it in TeamCity? I don't expect NUnit tests to run in the MsBuild step in TeamCity. As I know, I can creat another Build Step using NUnit runner to do it. Now I just want to pass the first MsBuild Step.

My environment:

  • Visual Studio 2015 community
  • .Net 4.6
  • NUnit 2.6.2
  • TeamCity 9.1.7
codigube
  • 1,186
  • 1
  • 12
  • 31

2 Answers2

2

Your project is referencing NUnit, but it doesn't exist in the relative path of your project root.

First, add NUnit as a NuGet package then add a NuGet Installer build step before MSBuild to restore packages on your .sln file.

KMoraz
  • 14,004
  • 3
  • 49
  • 82
  • Thank @KMoraz, I already have NUnit package installed. I just need to add NuGet Installer Build Step before the MSBuild step. It worked now. – codigube Jul 18 '16 at 08:51
1

You need to restore NuGet packages. Try adding NuGet Installer step. You will probably have to select NuGet version in https://teamcity.example.com/admin/admin.html?item=nugetServerSettingsTab&nuget-section=nuget-exe

J2ghz
  • 632
  • 1
  • 7
  • 20