2
votes

I am attempting to create my first ever agent build using on my my asp.net mvc projects. The agent is on my own computer. Everything appears to work fine up until after the nuget restore.

Picture:

enter image description here

It is telling me that my System.Web.MVC assembly could not be located. Since this is of course my first build I am unsure of what to do or what could cause this issue especially since it builds fine locally in VS.

Any help would be greatly appreciated:

TFS Version: 16.122.27102.1

1
Hi Selthien, any update for this issue?LoLance
Still working on it I had to walk away for a bit to do something else but I will def look at trying what you suggested.Selthien

1 Answers

1
votes

You can follow steps below to locate the cause of the issue and resolve it:

1.The Nuget 4.3.0 you're using is too old. Instead you should use recommended 5.7.0. (Modify your Use Nuget Task)

2.Check log of your restore step.

  • The missing System.Web.MVC comes from Microsoft.AspNet.Mvc nuget package, so you should make sure this package is actually downloaded/installed. And make sure the hintPath in your csproj is correct compared to the installation path of the nuget package.

  • Also make sure you're restoring for whole solution instead of one specific project.

  • Check whether you added packages folder into source control. The packages folder in SolutionDir should not be added into source control! It will affect the restore stop.

3.Check MSBuild arguments of Build task, you can share the arguments and build logs here if convenient.