How do I delete NuGet packages that are not referenced by any project in my solution? Ask Question

How do I delete NuGet packages that are not referenced by any project in my solution? Ask Question

Somehow during the upgrade to VS2012 and .NET 4.5, I've managed to get NuGet confused. There are packages that appear in the package manager (and the packages folder) that I cannot delete (I believe they are legacy ASP.NET NuGet packages that have been replaced with new package names with the new version. They each have only a Manage button -- but no uninstall button. And when you look to see where they are used, you can see that they are referenced by none of the solution's projects? They are NOT displaying an Uninstall?

ベストアンサー1

I've found a workaround for this.

  1. Enable package restore and automatic checking (Options / Package Manager / General)
  2. パッケージ フォルダーの内容全体を削除します (心配な場合はごみ箱に削除してください)。
  3. ソリューションの NuGet パッケージを管理する
  4. 復元ボタンをクリックします。

NuGetは復元しますのみソリューションで使用されるパッケージ。 最終的には、整理された優れたパッケージ セットが完成します。

おすすめ記事