Reputation: 171
I have read probably a hundred links online to try to find an answer, and I'm flat out of explanations.
I have a TFS 2013 Server running Git Team Projects. I create a TFS build to build a service which uses public (Entity Framework) nuget packages as well as a couple of our own libraries that are packaged as Nuget packages on an IIS server. I'm using Automatic Package Restore and NOT the 'deprecated' MSBuild "Enable Package Restore". Thus the only nuget file in the .nuget folder is nuget.config (which I've also tried moving into the root folder)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="myserver" value="http://myserver/Nuget/Nuget/" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
</packageRestore>
</configuration>
The thing is, when I remote into the build box, and try this from a command-line:
nuget.exe list -source http://myserver/nuget/nuget
It does list all the packages.
But a TFS build, DOES pull down Entity Framework from nuget.org...but then it tries to build:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets
(1697,5): warning MSB3245: Could not resolve this reference.
Could not locate the assembly "MyEntitiesLib".
Check to make sure the assembly exists on disk.
If this reference is required by your code, you may get compilation errors.
So, I'm at my wits end here. Both the project's nuget.config adn the default nuget.config in the msbuild tools folders have my source, I can list it from a command line, but Automatic Package Restore is NOT pulling that package down, and blowing up on compile.
Help anyone?
Upvotes: 0
Views: 247
Reputation: 171
The answer was to be found in the unlikeliest place.
Nuget fails to install specific version
I had built packages that had symbols versions side by side with non-symbols version, and nuget restore was obviously giving up on them. The hint was the warning about duplicate root nodes when I tried to run Nuget.exe Restore manually from the build box. I could list the packages, but I could not restore them. Once I deleted the *.symbol.nupkg files from the Nuget Repository, the packages were restored and the build worked properly.
Thank you to everyone. I hope this helps someone else out.
Upvotes: 1