开发者

Remove NuGet official feed permanently

My network has no access to the internet

I setup a local web based feed and all is well, except that the update tab always shows me the following warning

"The remote name could not be resolved: go.microsoft.com"

This is obvious because I don't have internet connection,

If I remove the official feed from the Nuget feed sources (in the se开发者_C百科ttings window)

everything works fine, until I restart Visual Studio and then the official feed comes back to the sources list.

Is there a way to permanently remove the official feed from the list of feeds?

I used reflector to see what is going on behind the scenes and I found out that the Nuget adds the official feed if it is not present when trying to persist the list of feed sources to disk.


Not sure if this helps (I didn't notice this behavior before), but did you try removing the official NuGet feed entry from the 'activePackageSources' element in the NuGet.config? You can find it in the following directory: %UserProfile*\AppData\Roaming\NuGet

Edit: Please make sure the nuget.config file does define at least 1 package source, or it will indeed fall back to the hardcoded official NuGet feed URL.

Regards, Xavier


You could add a local hostfile (or DNS) entry for go.microsoft.com which points to a local web server, which in turn serves up an effectively empty feed file.

A bit hacky, but this trick has worked for me in the past.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜