1
  • How do I uninstall a package by id and version for all solutions and projects under a folder?
  • How do I install a package by id and version for all solutions and projects under a directory?

There is a package manager approach with somewhat Similar Post that shows how to do that for all projects under A solution. You can use Package Manager Console from solution and use this for one solution. But how to do the same across multiple solutions and projects under them?

Cannon
  • 2,725
  • 10
  • 45
  • 86
  • Right click on your solution, then manage nuget packages – Alaa Mohammed Jun 18 '20 at 20:33
  • That's for A solution. I need to do that under code repository, all solutions, all projects under every solution. – Cannon Jun 18 '20 at 20:42
  • Check this https://stackoverflow.com/questions/18376313/setting-up-a-common-nuget-packages-folder-for-all-solutions-when-some-projects-a – Alaa Mohammed Jun 18 '20 at 20:50
  • I will put some custom script considering no out the box solution here – Cannon Jun 25 '20 at 19:56
  • For powershell script, you can try [this similar link](https://stackoverflow.com/questions/28596666/how-do-i-uninstall-all-nuget-packages-from-a-solution-in-visual-studio). – Mr Qian Jun 29 '20 at 08:46

1 Answers1

0

But how to do the same across multiple solutions and projects under them?

You cannot get what you want at present.

To uninstall packages, you should only use Manage Nuget packages for solution UI or Package Manager Console to uninstall one package for one solution. You can not use it to uninstall a package for several solutions at the same time. VS IDE does not support it.

Suggestion

So you should open a solution each time and run this command on Package Manager Console:

Get-Project -All | Uninstall-Package xxx<package_name>

Or use Manage Nuget Packages for Solution

Besides, If you still want this feature, I suggest you could suggest a feature on our User Voice Forum.

enter image description here

You can share the link with us here and anyone who is interested in it including us will vote it so that it will get more Microsoft's attention as soon as possible.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41