0

I am trying to set up automated builds in TFS2015. The goal is to have solutions automatically build and tested when checked in and if everything passes then a new Nuget package is created and placed in a local repository.

This process works fine for my first solution which is a simple project with no dependencies. The Nuget package that is created from this project is then used by a second project as a dependency.

This works fine when building in Visual Studio. The package is downloaded and extracted as normal. However when I check this second project in to TFS the automated build does not handle this package properly. The package is restored from the local repository but it is not extracted. This means that the build fails as it cannot find the actual DLL that it requires.

I am also using EntityFramework in the project and it works correctly. The package is downloaded but then it is also extracted.

I have tried the workaround given in this question but the TFS server does not have a C:\Users.nuget\packages folder.

I've also tried to clear the Nuget cache using the command here but again that didn't help.

If I manually extract the Nuget package that gets downloaded by the automated build and then run the build again it works which suggests that the issue isn't with the package itself?

Nuget.exe version is 3.5. .Net version is 4.5 standard. Packages are referenced in packages.config and also by project reference. Nuget.exe is being used for the restore.

Any idea on why the local package is not being extracted?

Community
  • 1
  • 1
ChrisW
  • 83
  • 3
  • 11
  • What kind of project are you using? classic .net, .net core/standard (> "SDK"-projects). packages.config or ProjectReference? Are you using nuget.exe to restore? – Martin Ullrich May 17 '17 at 10:12
  • .Net version is 4.5 standard. Packages are referenced in packages.config and also by project reference. Nuget.exe is being used for the restore. – ChrisW May 17 '17 at 10:15
  • And when you delete the solution-local packages folder, does it work on your machine? I suspect the package reference is missing from the packages.config and might work by chance on your dev machine. – Martin Ullrich May 17 '17 at 10:22
  • I deleted the solution packages folder and rebuilt and it downloaded and extracted correctly locally. I did the same on the build server and it downloaded the package there but did not extract it – ChrisW May 17 '17 at 10:32

1 Answers1

0

The cause of this turned out to be that I had accidentally checked in the packages folder in this project as some point so what appeared to be coming from my local Nuget folder was actually just being copied out of the packages folder in the project.

Removing the packages folder from TFS resolved the issue.

Still not sure why it didn't extract the package in any case but problem solved.

ChrisW
  • 83
  • 3
  • 11