简体   繁体   English

无法为VS2015升级nuget

[英]failed to upgrade nuget for VS2015

i am in the process of installing a big C# project and i was told to upgrade nuget from 3.3 to 3.4 or above first. 我正在安装一个大型C#项目,并被告知要先将nuget从3.3升级到3.4或更高版本。

I downloaded nuget extension (VS 2015 VSIX v3.4.4) and tried to install it, i got this: 我下载了nuget扩展(VS 2015 VSIX v3.4.4)并尝试安装它,我得到了:

8/7/2017 2:04:32 PM - Upgrading 'NuGet Package Manager for Visual Studio 2015', version 3.3.0.167 to version 3.4.4.1321.
8/7/2017 2:04:41 PM - Install Error : System.IO.IOException: The process cannot access the file because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

I tried another way - from within VS2015, Tools -> Extensions and Updates, found existing nuget and tried to uninstall it first, I got: 我尝试了另一种方法-从VS2015的工具->扩展和更新中,找到现有的nuget并尝试首先将其卸载,我得到了:

The process cannot access the file because it is being used by another process.

I whipped out "Process explorer" and found that two processes used nuget: chrome and devenv.exe. 我拿出“进程浏览器”,发现有两个进程使用了​​nuget:chrome和devenv.exe。 devenv is a process with VS2015 instance. devenv是VS2015实例的进程。 Anyway I exited VS2015, even chrome, no help, same error message as the one when installing the extension. 无论如何,我退出了VS2015,即使是Chrome,也没有帮助,与安装扩展程序时出现的错误消息相同。

Other things I tried: 我尝试过的其他方法:

I found that nuget being used is at "C:\\Program Files (x86)\\NuGet", I replace the existing one with a new version of nuget.exe, as well as nuget.tools under C:\\Program Files (x86)\\NuGet\\Visual Studio 2015, then I started VS again still get the same message 我发现正在使用的nuget位于“ C:\\ Program Files(x86)\\ NuGet”,我用新版本的nuget.exe以及C:\\ Program Files(x86)下的nuget.tools替换了现有的nuget。 \\ NuGet \\ Visual Studio 2015,然后我再次启动VS仍然收到相同的消息

The process cannot access the file because it is being used by another process.

I removed the packages folder under the project as well as that under /.nuget, didn't help. 我删除了项目以及/.nuget下的packages文件夹,没有帮助。

I googled and found this link but it didn't help solve the problem either. 我用Google搜索并找到了此链接,但它也无助于解决问题。 I admit that I am at my wit's end. 我承认我已经走到了尽头。

failed to upgrade nuget for VS2015 无法为VS2015升级nuget

This issue should be a bug or issue in the core visual studio extensibility. 此问题应该是Visual Studio核心可扩展性中的错误或问题。 It is not a NuGet specific issue. 这不是特定于NuGet的问题。 It is generally tied to things like anti virus or encryption services . 它通常与诸如防病毒或加密服务之类的东西捆绑在一起。 I would like provide some troubleshootings here: 我想在这里提供一些疑难解答:

  • Log in to your computer as an administrator and start Visual Studio with administrator. 以管理员身份登录到您的计算机,然后以管理员身份启动Visual Studio。
  • Check if your computer has a McAfee Endpoint Encryption full-disk encryption product installed, not the antivirus. 检查您的计算机是否安装了McAfee Endpoint Encryption full-disk encryption product ,而不是防病毒软件。 If yes, you should exclude devenv.exe and VSIXInstaller.exe from full-disk encryption. 如果是,则应从全盘加密中排除devenv.exeVSIXInstaller.exe

    Here's a registry snippet to tell McAfee Endpoint Encryption to exclude these files. 这是一个注册表片段,告诉McAfee Endpoint Encryption排除这些文件。 Once you do that, reboot PC: [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\MfeEEFF\\ExemptedProcesses] "1"="devenv.exe" "2"="VSIXInstaller.exe" 完成后,重新启动PC: [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\MfeEEFF\\ExemptedProcesses] "1"="devenv.exe" "2"="VSIXInstaller.exe"

    For the detail info, please check the answer for the same issue on SO. 有关详细信息,请检查关于SO 的相同问题的答案

  • Close visual studio and delete all the folders in C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions that contain a copy of Nuget 关闭Visual Studio并删除C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions中包含Nuget副本的所有文件夹

    1. Close all instances of Visual Studio. 关闭Visual Studio的所有实例。

    2. Go to your global Visual Studio extensions folder. 转到您的全局Visual Studio扩展文件夹。 NuGet doesn't install in your per-user folder; NuGet不会安装在您的每用户文件夹中; instead, you'll see it in Program Files. 相反,您将在“程序文件”中看到它。 Something like: C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\Extensions 类似于:C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE \\ Extensions

    3. Look in that folder. 在该文件夹中查找。 You will see a lot of randomly named folders like “sdjfksiov.djd” and so on. 您会看到很多随机命名的文件夹,例如“ sdjfksiov.djd”等等。 Most (if not all) of those are NuGet. 其中大多数(如果不是全部)都是NuGet。 You'll want to be aware of which ones are NuGet and which ones aren't, particularly if you have other extensions installed. 您需要知道哪些是NuGet,哪些不是,特别是如果您安装了其他扩展。 (You can tell if it's NuGet because it'll have a bunch of NuGet.*.dll files in there. If you don't see NuGet stuff in there, you'll want to keep it.) (您可以确定它是否为NuGet,因为其中将包含一堆NuGet。*。dll文件。如果您在其中看不到NuGet的内容,则需要保留它。)

    4. Rename that Extensions folder to something like: C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\Extensions_RENAMED 将该扩展文件夹重命名为:C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE \\ Extensions_RENAMED

    5. Download NuGet directly from the Visual Studio extension gallery. 直接从Visual Studio扩展库下载NuGet。

    6. Execute the downloaded NuGet.Tools.vsix file you just downloaded. 执行刚刚下载的已下载的NuGet.Tools.vsix文件。 Don't do it through Visual Studio. 不要通过Visual Studio做到这一点。 Just double-click the .vsix file to install it. 只需双击.vsix文件进行安装。

    7. NuGet should successfully install. NuGet应该成功安装。 As part of that install, it will create the Extensions folder again, so you will once again see C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\Extensions 作为该安装的一部分,它将再次创建Extensions文件夹,因此您将再次看到C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ Common7 \\ IDE \\ Extensions

    8. Open up your renamed extensions folder and move all of the non-NuGet extensions into the new Extensions folder. 打开重命名的扩展文件夹,然后将所有非NuGet扩展都移到新的扩展文件夹中。

    9. Now open Visual Studio. 现在打开Visual Studio。 You should see the new version of NuGet installed and working. 您应该看到新版本的NuGet已安装并且正在运行。

    10. You can delete that renamed Extensions folder once you've verified everything is working 确认一切正常后,您可以删除该重命名的Extensions文件夹

Hope this can give you some help. 希望这可以为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM