MicroMan
MicroMan

Reputation: 2098

Custom Nuget config not finding package

I have a Internal Nuget Server and TFSbuild 2015

I have one internal reference on the server

When i build locally it picks it up no problem

But using TFS 2015 when I create a build it fails to find that reference.

I have a Nuget.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>  
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
        <add key="Internal" value="\\***\NugetPackages" />
  </packageSources>
</configuration>

I have read many articles and I have tried adding the Nuget.Config to

  1. The root of My Repository
  2. On the Build Server to path C:\ProgramData\NuGet\Config\Nuget.Config
  3. To the working path of agent on the same build server

But it never finds my custom package

Upvotes: 2

Views: 2365

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51073

There is a build Task called NuGet Installer this allows you to check in your NuGet.config file and specify the different package sources. Run this task before you run MSBuild. enter image description here

If you are not using this task, suggest you to use it. Just need RTM of Team Foundation Server 2015 and above. More details please see How to get TFS2015 Build (Build.vnext) and NuGet package restore to use custom package sources.

If you have already using it, you need to use your custom NuGet feed URL’s instead of a local network share folder such as -source "\\myNetworkShare\Nuget Packages" in the .config file to hold the packages. Detail ways about this please refer How to host your own NuGet Server and Package Feed

enter image description here

Upvotes: 4

Related Questions