0
votes

I have a small solution containing three Visual Studio projects. I'm working in Visual Studio 2015 using TFS 2015.

I have implemented a gated check in, but for some reason the solution will not build on the TFS server. I'm referencing only 1 nuget package - Entity Framework. I am not checking my package folder into TFS, but my packages.config files are being included.

My Errors

I have previously set up a different project on the same server using the same build definition and it works fine.

2
Does your build server have access to nuget.org? If you look at the diagnostic log for your build, what error does it show when trying to restore the packages? There should be an entry for NuGet before MSBuild starts.Daniel Mann

2 Answers

1
votes

In order to restore packages prior to build, you will need to run the following command as part of your build process.

nuget.exe restore path\to\solution.sln

One way to do that is to add another project that is responsible for building your solutions and making sure that the packages get restored prior to your solutions being built.

Following write-up walks you through getting that set up: nuget docs

0
votes

I managed to get it working, but I tripped into the fix and don't know what exactly solved the problem. This is the first time I've really had to handle TFS builds.

I know I only had one build definition defined and it was intended for a different solution - of which this code was also a part. I think when I was checking in this solution it was actually trying to build the other.

Apparently, I can't have my nuget packages set up different ways for code that is in two different solutions. Anyway, that's my best guess.