Open liushuanggang opened 6 years ago
This is by design to resolve dependencies from all active sources. One workaround is to disable all other sources from tools -> options -> NuGet package Manager
@jainaashish, Thanks for your reply. Yes, I know it is by design. Your workaround is exactly what I am did. But if there is a a parameter here that allows us to choose whether restore dependencies from nuget.org? like, -source nuget.org -IncludeDependecies
. Is this better? Or this request will have a lower priority.
@jainaashish What's driving our team nuts is that we have a TFS 2017 feed with an internal package that has dependencies on Nuget.org. It takes a long time for a solution to upgrade to a newer version of our internal package because it is trying to retrieve all the dependencies from our internal server, which it doesn't have them (there on Nuget.org). I tried downloading the packages from Nuget.org and putting them on our internal feed, but it doesn't make any differences in the speed because there are still lots of requests that fail because there are dependencies OTHER than the ones that the package says it depends upon (most are for things that come with windows, but I guess it has to check to see if a Nuget package should be download if a particular package isn't on a computer). It would be nice to be able to give a package a hint as to where to get a dependency. So perhaps in the nuspec file, you could name your dependencies and then set a hint to its location (e.g.,Nuget.org or from an internal feed ).
Details about Problem
When we install a nuget package
Microsoft.Owin.Host.SystemWeb
with a specify nuget source-source nuget.org
, which dependencies areOwin
andMicrosoft.Owin
. NuGet will retrieve nuget packageMicrosoft.Owin.Host.SystemWeb
only from the specify sourcenuget.org
but it detect the dependencies packages from other package sources.For example, I install the nuget with command line on the Package Manager Console:
Install-Package Microsoft.Owin.Host.SystemWeb -verbose -source nuget.org
The output log:
As you can see from the log, nuget detect the dependencies packages from other package source
myget
. Sometimes detection time will be very long, so I want if we could have any option to force nuget only detect the specify nuget source when it attempting to gather dependency information, for example,Install-Package Microsoft.Owin.Host.SystemWeb -verbose -source nuget.org -IncludeDependecies
NuGet version (x.x.x.xxx):
nuget 4.6.0
VS version:
VS2017 15.6.6
OS version:
Win10