Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing nuget.org source after updating to NuGet 3.4.1 #2445

Closed
tbolon opened this issue Apr 4, 2016 · 7 comments
Closed

Missing nuget.org source after updating to NuGet 3.4.1 #2445

tbolon opened this issue Apr 4, 2016 · 7 comments
Assignees
Labels
Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Type:Bug
Milestone

Comments

@tbolon
Copy link

tbolon commented Apr 4, 2016

I could not determine if this problem is related to #2429, because in my case it is the behavior of VS which was changed.

Since I installed VS 2015 Update 2 (I have juste tried to add a new package today), the Package Source is stuck in "Microsoft and .NET" source, and no other sources are available: the officiel nuget.org source was gone.

My %appdata%\nuget\nuget.config was this (never edited by hand, never customized in VS):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <activePackageSource>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </activePackageSource>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
</configuration>

In visual studio Options screen, the available package sources was empty.

What seems strange is that nuget sources list in the console was still displaying nuget.org as enabled:

C:\Users\Thomas\.nuget\bin>nuget sources list
Registered Sources:
  1.  nuget.org [Enabled]
  https://api.nuget.org/v3/index.json

Plus, in the Options UI, the "+" and "Delete" buttons are grayed as soon as I click on the machine-wide package. Even when I deselect the Microsoft and .NET package source the buttons remains grayed. The only solution to allow the "+" button to be available again is to restart visual studio then go to the options screen, then press "+" without clicking anywhere in the listboxes.

As a workaround, you can delete the nuget.config in %appdata%\nuget\nuget.config. The next time you restart VS, nuget will generate a default configuration file. note that this delete any custom configuration. (source: nuget FAQ)

My config is now:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

And now I can choose "All" (or nuget.org) as a package source when searching in nuget ui.

I do not know exactly the origin of the problem, but it seems to be related to VS 2015 update 2, or something similar, because of the timing.

@tbolon tbolon changed the title Corrupted appdata Nuget.config after VS 2015 Update 2 Missing nuget.org source after VS 2015 Update 2 Apr 4, 2016
@IldarDev
Copy link

IldarDev commented Apr 4, 2016

I have the same problem!

  • 1
    123

Please, help! I can't go on work on my project without nuget.org source.

@tbolon
Copy link
Author

tbolon commented Apr 4, 2016

@IldarDev As explained in my issue, you can delete %appdata%\nuget\nuget.config then restart VS: the default source should be back.

Note also that based on his screenshot, it seems that VS 2015 update 2 is not the culprit. Perhaps NuGet 3.4.1 ?

@tbolon tbolon changed the title Missing nuget.org source after VS 2015 Update 2 Missing nuget.org source after updating to NuGet 3.4.1 Apr 4, 2016
@IldarDev
Copy link

IldarDev commented Apr 4, 2016

It's works! Thx bro!

@IldarDev
Copy link

IldarDev commented Apr 4, 2016

Maybe, it problem of 3.4.1 version. I have updated to latest version yesterday.

@zhili1208
Copy link
Contributor

@tbolon the issue here is not in 3.4, it's in 3.3, 3.3 will create an empty config file on your machine just like what you post here, but because we forced user to have nuget.org from nuget code in 3.3, then user can't hit this issue. but in 3.4, this issue is fixed and we will not force user to have nuget.org and respect what user have in config file, then you hit this issue. so if you have old config file on your machine, you need to delete it and 3.4 will create a right one for you. And For Plus button bug, the fix for that is in PR, 3.4.2 will have the fix. Sorry for the inconvenience.

@emgarten emgarten added this to the 3.4.2 milestone Apr 4, 2016
@zhili1208
Copy link
Contributor

we will provide a fix in 3.4.2 to add nuget.org to empty config file.

@Krizario
Copy link

@IldarDev As explained in my issue, you can delete %appdata%\nuget\nuget.config then restart VS: the default source should be back.

Note also that based on his screenshot, it seems that VS 2015 update 2 is not the culprit. Perhaps NuGet 3.4.1 ?

Thank You.. Problem Solved (Y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:1 High priority issues that must be resolved in the current sprint. Product:VS.Client Type:Bug
Projects
None yet
Development

No branches or pull requests

6 participants