0

I've setup a nuget server and successfully published a package which has an external dependency located on nuget.org.

When trying to install my package, I get an error saying "Package NPOI 2.2.1 is not found on source (my local server)".

Can I tell nugget/Visual Studio to get this external dependency from nuget.org and not my local server?

I'm using Visual Studio 2015 and tried creating a NuGet.Config file next to the .sln file containing the following which didn't work.

<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="MyServer" value="http://nuget.dev.mynugetserver.com/nuget/" />
  </packageSources>
  <disabledPackageSources />
  <activePackageSource>
      <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>

Thanks

Noobie3001
  • 1,230
  • 18
  • 31
  • Have you tried Tools-->Options-->NuGet Package Manager-->Package Sources? I don't recall offhand if it allows pull from multiple sources in one "transaction". – Kit Feb 07 '17 at 17:14
  • Hi, Yes I've setup my nuget server source as you described. – Noobie3001 Feb 07 '17 at 17:21
  • I guess I should be more specific: do you have both sources listed and checked? Another option might be to see if your NuGet server can forward the request to nuget.org; I know that ProGet has this ability. – Kit Feb 07 '17 at 17:42
  • I've been battling away for hours, I zipped up the original files and started hacking away, randomly changing versions of nuget.server. After all that.. I put the original zip contents back in and it worked! Absolutely no idea how..how frustrating – Noobie3001 Feb 07 '17 at 23:44
  • Did your package is used by other process in the "Myserver" when you install this package? Or nuget.org could not be accessed on that time? – Leo Liu Feb 08 '17 at 08:19

0 Answers0