Skip to content

Missing Nuget Packages on TFS Build Server

Robert Greiner
Robert Greiner
2 min read

This is a guest post from Scott Decker.

Our team recently migrated some client projects over from Team Foundation Server to Team Foundation Service (TFS). Connecting to TFS and porting the code presented little challenge. Once the builds were set up, we encountered the real trouble: missing dlls. Yes, “Enable Nuget Package Restore” was selected. Yes, nuget.exe had been added to source control. Yes, I had checked the version of the nuget packages to see if an update had messed something up. All to no avail. The key lied in repeating a process we normally execute locally the first time we download a new solution from source control.

When the solutions were first built locally, there were tons of errors concerning missing dlls (see below). We had to close Visual Studio, delete the “packages” folder locally, reopen the solution, and rebuild. Tada.

With Nuget, you don’t have to check in the packages folder. Nuget should be able to tell which packages it needs and download any missing ones. This functionality, however, wasn’t working on the build server just as it wasn’t working on the local machine. The error (below) was a little different but the root issue was the same: missing packages.

The solution ended up being remarkably simple: repeat the steps we perform locally in source control.

  1. In Visual Studio, open the Source Control Explorer.
  2. Navigate to the packages folder (it should be on the same level as the projects in the solution).
  3. Right click and select “Delete”. A small red x should appear next to the name.
  4. Check in the pending change (deleting the packages folder) and wait.

If all goes well, that automatic build should kick off with the new check in and build successfully.

Note: the first build should take longer than usual as the server has to recreate the packages folder and download all packages.

Please consider subscribing, it's free.
Technology

Robert Greiner Twitter

Professional optimist. I write a weekly newsletter for humans at the intersection of business, technology, leadership, and career growth.


Related Posts

Members Public

AI Rule #1 - Customer First

In 1985, Warren Buffett wisely said, "The first rule of investment is don't lose. And the second rule of investment is don't forget the first rule, and that's all the rules there are." Similarly, the first rule of AI investment is to

AI Rule #1 - Customer First
Members Public

Navigating the Upside Down as a Technology Leader

Ideas for leading technology organizations with confidence and creativity.

Navigating the Upside Down as a Technology Leader
Members Public

Artist for a Day

The future of creative output is multiplied by AI.

Artist for a Day