Slow NuGet.exe performance when "Automatically Detect Settings" Enabled

Apr 12, 2011 at 2:42 AM

Hi everyone,

I found what I thought was a NuGet performance problem while attempting to implement the approach described by David Ebbo here:  After some digging, I discovered that it isn't really NuGet that's to blame.  It appears that checking the "Automatically Detect Settings" box under Control Panel -> Internet Options -> Connections -> LAN Settings adds a significant amount of overhead to running NuGet.exe install /path/to/packages.config.  With that option checked, each call to NuGet.exe was taking anywhere from 5 to 10 seconds to complete.  After unchecking it, each call to NuGet.exe takes less than half a second.  

I don't remember exactly why I enabled this option recently.  Some other application I was using wouldn't work correctly without it enabled. Since there are going to be some cases where this needs to be enabled, it might be worthwhile to investigate if there are ways to reduce or eliminate this overhead.  

Thanks for making such an awesome tool!

Apr 12, 2011 at 7:25 AM

Indeed, even when all the packages are already installed, we still make one little request to This happens in PackageRepositoryFactory.CreateRepository as we try to resolve the redirect in the URL. However, we should be able to postpone this work until we know for sure that we need to use this remote repository. So in the case where all the packages are already installed, we should be able to avoid all requests.

Apr 12, 2011 at 7:26 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.