0

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.

I downloaded nuget extension (VS 2015 VSIX v3.4.4) and tried to install it, i got this:

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:

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. devenv is a process with VS2015 instance. Anyway I exited VS2015, even chrome, no help, same error message as the one when installing the extension.

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

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.

I googled and found this link but it didn't help solve the problem either. I admit that I am at my wit's end.

J.E.Y
  • 925
  • 11
  • 26
  • Do you have disk encryption enabled? – gravity Aug 07 '17 at 19:04
  • this is the office computer, I don't think so but not sure, how can I tell? – J.E.Y Aug 07 '17 at 19:05
  • Ask your infrastructure people. –  Aug 07 '17 at 19:53
  • @J.E.Y, what about this issue? Would you please let me know the latest information about this issue? – Leo Liu-MSFT Aug 10 '17 at 08:07
  • @Leo-MSFT, thank you very much for your detailed explanation and instructions and follow-up. Sorry I haven't got a chance to check them out yet, will do it today and let you know. BTW, are you associated with Microsoft? – J.E.Y Aug 10 '17 at 13:25
  • @J.E.Y yes, if you have any update for this issue, please let me know for free. – Leo Liu-MSFT Aug 14 '17 at 08:48
  • hi, Leo. I might have deleted some files that I shouldn't - now I can get a VS2015 up but it's totally responsive to nothing, no clicks, no hotkeys, no nothing. I can only kill the IDE from task manager. – J.E.Y Aug 28 '17 at 16:46
  • @J.E.Y, you should repair Visual Studio first. – Leo Liu-MSFT Sep 01 '17 at 08:59

1 Answers1

0

failed to upgrade nuget for VS2015

This issue should be a bug or issue in the core visual studio extensibility. It is not a NuGet specific issue. 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.
  • Check if your computer has a McAfee Endpoint Encryption full-disk encryption product installed, not the antivirus. If yes, you should exclude devenv.exe and VSIXInstaller.exe from full-disk encryption.

    Here’s a registry snippet to tell McAfee Endpoint Encryption to exclude these files. Once you do that, reboot 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.

  • 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

    1. Close all instances of Visual Studio.

    2. Go to your global Visual Studio extensions folder. NuGet doesn’t install in your per-user folder; instead, you’ll see it in Program Files. Something like: 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. Most (if not all) of those are NuGet. You’ll want to be aware of which ones are NuGet and which ones aren’t, particularly if you have other extensions installed. (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.)

    4. Rename that Extensions folder to something like: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions_RENAMED

    5. Download NuGet directly from the Visual Studio extension gallery.

    6. Execute the downloaded NuGet.Tools.vsix file you just downloaded. Don’t do it through Visual Studio. Just double-click the .vsix file to install it.

    7. NuGet should successfully install. 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

    8. Open up your renamed extensions folder and move all of the non-NuGet extensions into the new Extensions folder.

    9. Now open Visual Studio. You should see the new version of NuGet installed and working.

    10. You can delete that renamed Extensions folder once you’ve verified everything is working

Hope this can give you some help.

Leo Liu-MSFT
  • 52,692
  • 7
  • 69
  • 81