How can I completely remove the official NuGet feed packages source (URL).

Topics: General
Jan 22, 2013 at 9:05 PM
Edited Jan 22, 2013 at 9:07 PM

I am part of a large organization trying to implement Nuget.
Our requirement is not to have a public repository (https://nuget.org/api/v2/).


How can we completely remove the official NuGet feed packages source (URL)?

I know we can enable/disable the link from Settings window.

But I am more interested in completely removing this URL.

I tried updating Nuget.Config in the below folder location.

"[username]\AppData\Roaming\NuGet"

 
But Nuget would always put the URL back in the config file.

Jan 23, 2013 at 3:18 PM

We will put it back if you remove it, but if you configure it as disabled, we will leave it alone. You can put the disabled config into AppData, or into a nuget.config at the root of the enlistment. Putting it at the root of the enlistment will block NuGet from overwriting the config too, as the settings dialog only updates the AppData file.

Jan 23, 2013 at 7:14 PM

Thanks for the information.

I added a config file at the root and it helps disable the official Source.

But when you have two Nuget.Config files with the same source name, it displays duplicate values in the Nuget Manager and Options window.

This also does not stop the users from enabling the official source again.

 

Also I noticed in the Nuget Source code the URL has been hard coded in the NuGetConstants.cs file.

public static readonly string DefaultFeedUrl = "https://nuget.org/api/v2/";

Why don't we have this Url value configurable so users can change the DefaultFeedUrl value if needed?

Do we already have an option to change this value?

 

Jan 23, 2013 at 8:16 PM

It's in as a constant because we had people remove it and then have no idea how to get it back.