问题描述
我无法更新或卸载适用于Visual Studio 2012的NuGet程序包管理器.我已经查看了几种解决方案,但是找不到可行的解决方案.
I am unable to update or uninstall the NuGet Package Manager for Visual Studio 2012. I've looked around to several solutions, but have not found one that works.
以管理员身份运行Visual Studio 2012 ...
Running Visual Studio 2012 as the administrator...
尝试更新NuGet软件包管理器失败,并且在日志末尾出现以下错误对话框:
Attempting to update the NuGet Package Manager fails, and I get this error dialog with the following at the end of the log:
接着是一个弹出窗口告诉我:
Followed by a popup telling me:
当我尝试先卸载扩展程序时(每个一些解决方案)我收到与上面相同的弹出消息,告诉我该过程正在使用中!
When I attempt to uninstall the extension first (per some solutions) I receive the same pop-up message as above, telling me the process is being used!
我为使该功能正常工作而采取的步骤:
Steps I've made in my attempts to get this working:
- 我已经多次重启VS2012,无论是否加载了项目.
- 我已经多次重启计算机,并且除了VS2012之外没有启动任何其他东西.
- 我已经从Web下载了NuGet安装程序,并尝试不从VS2012开始安装它(重启后的第一件事).
对于步骤3,我收到与尝试在Visual Studio 2012中进行更新时相同的一系列对话框/错误.
For step #3, I receive the same series of dialogs/errors as when attempting to update inside Visual Studio 2012.
无论如何尝试,我都无法获取最新版本!有人有其他把戏吗?
I can't get the latest version, no matter what I try! Does anyone have another trick?
我还注意到NuGet只是现在无法正常工作. "Package Manager控制台"或"Package Manager设置"均无任何作用.
I've also noticed that NuGet is just plain not working right now. Neither the "Package Manager Console" or the "Package Manager Settings" do anything.
推荐答案
来源:
这对我有帮助:
- 关闭Visual Studio的所有实例.
- 转到您的全局Visual Studio扩展文件夹. NuGet没有安装在您的每用户文件夹中;相反,您会在程序"中看到它文件.类似于:C:\ Program Files(x86)\ Microsoft VisualStudio 11.0 \ Common7 \ IDE \ Extensions
- 在该文件夹中查找.您会看到很多随机命名的文件夹例如"sdjfksiov.djd"等等.其中大多数(如果不是全部)是NuGet.您需要了解哪些是NuGet,哪些是NuGet.并非如此,特别是如果您安装了其他扩展程序.(您可以判断它是否为NuGet,因为它将有一堆其中的NuGet.*.dll文件.如果您在其中看不到NuGet的东西,您将要保留它.)
- 将该Extensions文件夹重命名为:C:\ Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ Extensions_RENAMED
- 直接从Visual Studio扩展库下载NuGet.
- 执行刚刚下载的已下载的NuGet.Tools.vsix文件.不要通过Visual Studio做到这一点.只需双击.vsix文件安装它.
- NuGet应该成功安装.作为安装的一部分,它将再次创建Extensions文件夹,因此您将再次看到C:\ Program Files(x86)\ Microsoft Visual Studio11.0 \ Common7 \ IDE \ Extensions
- 打开重命名的扩展文件夹,然后移动所有非NuGet文件夹扩展到新的扩展文件夹中.
- 现在打开Visual Studio.您应该会看到新版本的NuGet安装并正常工作.
- 验证后,您可以删除该已重命名的扩展程序文件夹 一切正常.
- 下载VSIX,然后右键单击取消阻止文件并重新安装
- Close all instances of Visual Studio.
- Go to your global Visual Studio extensions folder. NuGet doesn’tinstall in your per-user folder; instead, you’ll see it in ProgramFiles. Something like: C:\Program Files (x86)\Microsoft VisualStudio 11.0\Common7\IDE\Extensions
- Look in that folder. You will see a lot of randomly named folderslike "sdjfksiov.djd" and so on. Most (if not all) of those areNuGet. You’ll want to be aware of which ones are NuGet and whichones aren’t, particularly if you have other extensions installed.(You can tell if it's NuGet because it'll have a bunch ofNuGet.*.dll files in there. If you don't see NuGet stuff in there,you'll want to keep it.)
- Rename that Extensions folder to something like: C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions_RENAMED
- Download NuGet directly from the Visual Studio extension gallery.
- Execute the downloaded NuGet.Tools.vsix file you just downloaded.Don’t do it through Visual Studio. Just double-click the .vsix fileto install it.
- NuGet should successfully install. As part of that install, it willcreate the Extensions folder again, so you will once again seeC:\Program Files (x86)\Microsoft Visual Studio11.0\Common7\IDE\Extensions
- Open up your renamed extensions folder and move all of the non-NuGetextensions into the new Extensions folder.
- Now open Visual Studio. You should see the new version of NuGetinstalled and working.
- You can delete that renamed Extensions folder once you’ve verified everything is working.
- Download VSIX and right click unblock the file and install again
这篇关于无法在VS2012中更新或卸载NuGet程序包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!