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

Package update not found when updating via Visual Studio Solution #1827

Open
deadlydog opened this issue Dec 11, 2015 · 42 comments
Open

Package update not found when updating via Visual Studio Solution #1827

deadlydog opened this issue Dec 11, 2015 · 42 comments
Assignees
Labels
Functionality:Update The update package feature/command/experience Priority:2 Issues for the current backlog. Triage:Investigate Type:Bug
Milestone

Comments

@deadlydog
Copy link

This problem occurs occasionally when trying to update nuget packages from the NuGet package manager within Visual Studio 2015, but only occurs when updating packages at the solution level; that is, right click on the solution (not the project), and choose "Manager NuGet Packages for Solution...". It will find an update for a nuget package just fine and list the latest version, but after you select the projects to update and click the Install button, the installation fails with a message similar to the following in the Output window.

Package 'DansUtilityLibraries.CSharpLibrary' is not found in the following primary source(s): 'https://www.nuget.org/api/v2/'. Please verify all your online package sources are available.

Trying to do the install repeatedly just results in it failing with the same error.

Sometimes closing VS 2015 and reopening it will fix the problem and the install will succeed, but not all of the time. I have found that the most reliable work around is to right-click the project and choose "Manager NuGet Packages..." and do the update from that window, for each project that needs the update. For some reason updating the nuget package at the project level does not have the same problem; it only occurs at the solution level.

I didn't think to try doing the update from the NuGet Package Manager PowerShell Console, so I'll give that a try as well next time it happens and update this ticket with the results.

I first ran into this problem months ago when I updated to VS 2015 and NuGet Package Manager 3, but now after installing VS 2015 Update 1 and NuGet Package Manager 3.3.0.167 the problem persists. As I mentioned above, the problem does not happen every time; it seems to be sporadic.

@yishaigalatzer
Copy link

@deadlydog thanks for the feedback. We will try to get a repro and get it fixed. Are you seeing this for any particular package or packages that where just freshly pushed to nuget.org? What feed are you using? Can you share a fiddler trace when this issue happens again?

@yishaigalatzer yishaigalatzer added this to the 3.4 milestone Dec 14, 2015
@yishaigalatzer yishaigalatzer added Priority:2 Issues for the current backlog. Type:Bug labels Dec 14, 2015
@deadlydog
Copy link
Author

Now that you mention it, I have typically seen it when trying to download my own packages that were pushed very recently to nuget.org. If I encounter the issue again I'll try and provide a fiddler trace.

@yishaigalatzer
Copy link

This makes "some" sense, what you see is probably an incorrect propagation of pushed packages showing up in the search results but not yet available to download (this could happen if one server updated faster than another, and you hop between them). This is something we are working on improving.

Still just to verify it a fiddler trace will be of great help.

@deadlydog
Copy link
Author

Hi guys, so I was seeing this problem again and brought up fiddler. The new update that I just published showed up right away, but when trying to update I got the error. After bringing up Fiddler and hitting the Update button again, VS was not making a connection attempt at all to NuGet; it would just report the error. I flipped my package source to my work's internal repo and saw it make connections to it to do a search for updates, but when I flipped it back to nuget.org, again no connections. So even though I was getting the "loading" bar, it seems it was just searching it's local cache for updates, and not trying to go out to nuget.org. So I closed VS and reopened it, and this time everything worked. I'm guessing that closing VS invalidates VS's local cache so that it actually attempts to go to nuget.org to get the package. I hope that helps.

It seems pretty easy to reproduce if you guys want to give it a shot. Just upload a new package version to nuget.org and try and update to it within a few minutes of the upload (I had VS open while uploading the new version).

@deadlydog
Copy link
Author

Um, not sure how I unassigned @feiling from this ticket when I added my comment, but I'm not able to reassign him...

@yishaigalatzer
Copy link

No problems, @feiling left so it is just a github quirk. We now understand this issue, and it makes total sense, caching is expected. We should move this issue out as a lower priority item and deal with busting caches in this case.

@hakito
Copy link

hakito commented Feb 1, 2016

I think the problem is, that the nuget client caches http request for a package for 30 minutes:

https://github.com/NuGet/NuGet.Client/blob/5902aadde9f8a43b96c166b793101c23d6646dcf/src/NuGet.Core/NuGet.Protocol.Core.v3/RemoteRepositories/RemoteV2FindPackageByIdResource.cs#L134

We have the same problem with internal nuget packages for continuous integration builds. It would be great to disable this cache.

@yishaigalatzer yishaigalatzer modified the milestones: 3.4 Beta, 3.4 RTM Feb 25, 2016
@yishaigalatzer yishaigalatzer modified the milestones: 3.4 RTM, 3.4 RTM - Triage Mar 11, 2016
@yishaigalatzer
Copy link

@hakito this is not the case in 3.3, this is new code. And we have a way to deal with it by resetting the cache on install.

We are running out of time for 3.4, I'm moving to 3.5 for John to look at

@yishaigalatzer yishaigalatzer added the Functionality:Update The update package feature/command/experience label Mar 11, 2016
@yishaigalatzer yishaigalatzer modified the milestones: 3.5 Beta, 3.4 RTM - Triage Mar 11, 2016
@yishaigalatzer yishaigalatzer modified the milestones: 3.5 Beta, 3.5 RC Apr 8, 2016
@jainaashish
Copy link
Contributor

oops didn't mean to open it right away....

@tomRedox
Copy link

tomRedox commented Sep 24, 2018

Yep, same issue for me on vs 2017 15.8.4, @zorgoz 's solution fixed it for me.
Edit: as per @RyanMathewson we're getting this with Azure Devops Nuget server.
Also, I think the behaviour we are getting is that it works the first few times, then fails, and then I have to clear out the cache folder manually in Windows Explorer each time from then on until I close and reopen VS.

@Kranthi1547
Copy link

Yes, this issue still exists. @zorgoz solution fixed the issue in my case.

@RyanMathewson
Copy link

Same issue on VS 2017 15.9.2, specifically when pulling from packages published to our Azure Devops Nuget server. @zorgoz 's solution worked.

@jasonracey
Copy link

jasonracey commented Nov 27, 2018

Expanding on the workaround provided by @bvirkler here's more detail:

  1. Tools > NuGet Package Manager > Package Manager Settings
  2. Select NuGet Package Manager option
  3. Click Clear All NuGet Caches(s) button

@jainaashish
Copy link
Contributor

Reopening to run with an investigation

@johnfercher
Copy link

Same problem here, Clearing All Nuget Caches solved the issue.

@rrelyea rrelyea modified the milestones: 5.0, Backlog Feb 8, 2019
@ntrpnr
Copy link

ntrpnr commented Mar 12, 2019

Same issue with VS2017 15.9.8. Nuget package published to Azure Devops.

@alohaninja
Copy link

Same issue with VS2017 15.9.10. Nuget package published to Azure Artifacts - credential cache must be getting corrupted during the upgrade. VS installer should probably just do this action for you. 😉

I didn't have any other issues reading packages from the v3 feeds outside VS IDE.

Manually Resetting Nuget Cache in VS IDE after Updating

image

@samneefs
Copy link

samneefs commented Apr 5, 2019

I have the error also, but use another workaround:
I only get it on the solution level, when using the "Install" button, however, when you are on the "Updates" panel, there is also an "Update" button: using this button doesn't give the error.

After using alohaninja's solution: I can now use the "Install" button again.

@CrossBound
Copy link

Apparantly this is still an issue for VSTS nuget feed in Visual Studio 2019. I was just having the same issue with an internal package that I had updated. the fix suggested by @bvirkler in regard to clearing the nuget cache worked for me

@jaywha
Copy link

jaywha commented Jan 3, 2020

Still an issue in VS Pro 2019 v4.8.03761
Running an enterprise image of Windows 10
Just cleared the NuGet cache and all is well again.

@MichielCornilleESC
Copy link

Noticed this today
Vs Enterprise 2017 Version 15.9.12 , Azure DevOps private NuGet feed. (Own package)

@aortiz-msft aortiz-msft self-assigned this Mar 30, 2020
@aortiz-msft
Copy link
Contributor

Sorry to hear that this continues to be an issue for folks. We tried this on 16.6 Preview 1 and weren't able to reproduce the problem. These are the steps that we followed:

  1. Launch VS and create a solution with multiple projects (e.g. ASP.NET Web Application (.NET Framework)).
  2. Right click on the solution and choose “Manage NuGet Packages for Solution…”
  3. Go to “Updates” tab (make sure there are several non-latest packages installed).
  4. Select the project to update and click “Install” button.

Did we miss something? If someone could help confirm that this issue continues to be present in 16.6 Preview 1 or later, that'd be great!

Thanks!

@bgiromini
Copy link

bgiromini commented Apr 1, 2020

Sorry to hear that this continues to be an issue for folks. We tried this on 16.6 Preview 1 and weren't able to reproduce the problem. These are the steps that we followed:

  1. Launch VS and create a solution with multiple projects (e.g. ASP.NET Web Application (.NET Framework)).
  2. Right click on the solution and choose “Manage NuGet Packages for Solution…”
  3. Go to “Updates” tab (make sure there are several non-latest packages installed).
  4. Select the project to update and click “Install” button.

Did we miss something? If someone could help confirm that this issue continues to be present in 16.6 Preview 1 or later, that'd be great!

Thanks!

More broadly, any package that is recently published to a nuget feed will not be updated until some time after. So if you publish a nuget package to Azure DevOps, then try to update the package in another solution, Visual Studio will not see the new package.

@zivkan
Copy link
Member

zivkan commented Apr 1, 2020

@bgiromini the scenario you described sounds like a duplicate of #3116. If this whole issue is about the same scenario, packages not downloadable for about 30 minutes after publishing to a feed, then one of the two issues can be closed as a duplicate.

@ntrpnr
Copy link

ntrpnr commented Apr 16, 2020

I've seen this less often recently. It's is most likely related to newly published packages - but clearing the Nuget package cache is always the instant fix for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Update The update package feature/command/experience Priority:2 Issues for the current backlog. Triage:Investigate Type:Bug
Projects
None yet
Development

No branches or pull requests