Manage packages from the solution root shows unneeded updates

Jul 21, 2011 at 4:29 AM

If I go to Package Manager from the solution root context menu, I go to the Updates tab and several packages are displayed that either I removed from my solution, or were already updated at the project level. Each of them have update buttons, but when clicked, all the project nodes in the dialog are grayed out. I can't seem to completely resolve these package updates so they go away.

Jul 21, 2011 at 6:36 AM

That doesn't sound correct. Do you have a reproducible sequence of steps that leads to this situation?

Jul 21, 2011 at 7:16 PM

unfortunately not, but it happens every time now, whether I've closed/reopened VS or even rebooted. I frequently get TFS errors when installing packages which results in the package installs being rolled back. Maybe there's a bug in the way they are being rolled back??

Jul 21, 2011 at 7:28 PM

Can you give more details about what your solution looks like? e.g.

  1. List of sub folders under packages folder
  2. Content of packages.config file for each project
Jul 21, 2011 at 8:14 PM

ok, I think I figured it out. here's my directory structure


package1 is used by SolutionFoo
package2 is used by SolutionBar
package3 is used by neither

When I go to the Manage Packages when I have SolutionFoo open, it shows me all 3 packages, even though only package1 is being used by the solution

Jul 21, 2011 at 8:32 PM

Ah I see. Yes, this is a somewhat unusual situation. Here is the deal:

  • Package Manager at the solution level always deals with the entire list of packages that exist in the packages folder
  • It looks for available updates in any of those
  • When you actually try to perform an update, it looks for specific projects that actually have those packages installed. If the solution you have opened doesn't contain any such projects, then all projects will be grey out

So while it seems a bit quirky, it's not technically incorrect.

The one strange thing is that you should not have ended up with Package3 that no one uses. Is this something you installed and later uninstalled? What caused it to get in there in the first place?

Jul 21, 2011 at 8:39 PM

Would it make more sense for Package Manager at the solution level to look at the projects within that solution, inspect those packages.config, and just show those packages? I like the idea of using the solution level Package Manager to look for package updates (it would be a lot quicker than checking 10+ different projects individually) but in my case I had 2 full pages of packages that had nothing to do with my current solution file.

As for package3, you are correct - those ended up being packages that I had installed to evaluate the library, and later uninstalled it, the package folder just remained on disk I guess and Package Manager was finding it

Jul 21, 2011 at 8:43 PM

I think you have a point that ideally it would work that way.

As for Package3, normally it should have been completely deleted when it was uninstalled, so I'm not sure what happened there. Was it an empty folder, or did it still have the nupkg file in there?

Jul 21, 2011 at 8:44 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.