1
votes

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
2

2 Answers

2
votes

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.

1
votes

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