Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2015 Build: NuGet restore from an internal repository [duplicate]

We have set up an internal NuGet server and added that server into the package manager settings to publish our dependencies to our local dev machines. Now we want to use the new TFS 2015 Build system to build our solution.

at the start of the build NuGet.exe restore is called passing in the solution file as seen in the log file:

C:\Program Files\Microsoft Team Foundation Server 14.0\Build\agent\worker\tools\NuGet.exe` restore "D:\TfsData\Build\_work\a8a26a03\Source Code...etc\mySolution.sln" -NonInteractive

next line in the log is the error

##[error]Unable to find version '1.0.0.5' of package 'com.bmico.models.lookup'

Which is a package on my internal server?

How do I tell TFS Build 2015 to use my internal package repository as well as the publicly available one?

like image 716
Daniel Steenwyk Avatar asked Oct 02 '15 15:10

Daniel Steenwyk


1 Answers

In root of your repository add file 'nuget.config'

and content of file like where you use nuget.org and network share where you have your's nuget fiels.

<configuration>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="YoursNuGet" value="\\YourServerNugetShare\YourNuGets" />
  </packageSources>
</configuration>
like image 148
Janusz Nowak Avatar answered Sep 30 '22 15:09

Janusz Nowak