46

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.

Running Visual Studio 2012 as the administrator...

Attempting to update the NuGet Package Manager fails, and I get this error dialog with the following at the end of the log:

enter image description here

2/5/2013 10:38:09 AM - Beginning to install extension to Microsoft Visual Studio Ultimate 2012... 2/5/2013 10:38:09 AM - Upgrading 'NuGet Package Manager', version 2.0.30625.9003 to version 2.2.31210.9045. 2/5/2013 10:38:10 AM - 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) at System.IO.__Error.WinIOError() at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.AtomicallyDeleteFiles(IEnumerable1 filePaths, Boolean justMarkForDeletion) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.DeleteDiscoverableFiles(IInstalledExtension extension) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.UninstallInternal(IInstalledExtension extension, Boolean forceDelete) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CommitInstalledAndUninstalledExtensions(IEnumerable1 installedExtensions, IEnumerable1 uninstalledExtensions, IEnumerable1 packComponentChanges) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp)

Followed by a popup telling me:

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

enter image description here

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:

  1. I've restarted VS2012 multiple times, with and without projects loaded.
  2. I've rebooted the computer several times and started nothing other then VS2012.
  3. I've downloaded the NuGet installer from the web and tried to install it w/o starting VS2012 (first thing after reboot).

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?

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.

Community
  • 1
  • 1
Nicholas Pappas
  • 10,439
  • 12
  • 54
  • 87
  • when you did 3 it was the same error again? Have you searched for something relevant in windows EventLog? – Anri Feb 05 '13 at 18:49
  • I'd try installing it in safe mode. – Anri Feb 05 '13 at 18:57
  • For #3, I get the same error as when attempting to update inside VS2012 (question updated w/ pics). VS2012 is the latest version; no "Product Updates" appear in the "Extensions and Updates" dialog. – Nicholas Pappas Feb 05 '13 at 18:58
  • Let's check VS version, mine (updated to the last) is `11.0.51106.01 Update 1` – Anri Feb 05 '13 at 19:01
  • 1
    Safe Mode allowed me to install the downloaded package from outside Visual Studio (didn't try it inside VS). Please provide in answer so I can continue to load praise upon your help! :) My VS2012 was also of the same version as you quote above. – Nicholas Pappas Feb 05 '13 at 19:18
  • Good! I hate when something like this happens. The most usual case of setup problems i stumble into is when i delete some installation files in temp folders, of disable a service i don't use. Can you imagine that disabled service can break any setup process depending on it and you will spend tons of time researching why. – Anri Feb 05 '13 at 19:25
  • For me, a McAfee tool is blocking installation. – felickz Feb 17 '14 at 15:07

4 Answers4

82

Source:

This is what helped me:

  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.
  11. Download VSIX and right click unblock the file and install again
Kush
  • 273
  • 2
  • 9
nihique
  • 5,738
  • 2
  • 25
  • 27
  • 5
    @tillig ... wonder if it is the non standard naming of folders that McAfee is flagging as a potential virus "sdjfksiov.djd" – felickz Feb 17 '14 at 15:12
  • 5
    @felickz that may be the issue, on my work laptop we have McAffee installed – nihique Apr 23 '14 at 08:17
  • 3
    @felickz I've also experienced this issue and I also have McAfee installed on my work computer, and a coworker (w/McAfee too) also experienced this issue. The steps above worked for me, and when another update for NuGet was available, I had to repeat the work around again to get it installed. – YipYip May 07 '14 at 09:11
  • 1
    I tried doing the above steps and totally corrupted my existing nuget package manager, now it wont even show in visual studio. – Paul Fryer Jul 11 '14 at 14:42
  • 8
    Instead of renaming the whole file, simply check the folders for ones which contain nuget dll's. Delete/move these out of the folder. This allowed me to update Nuget and didn't mess up any other extensions installed. – Brettski Sep 30 '14 at 14:51
  • 1
    Had the same problem with 2013, I needed to delete those directories, renaming them didn't work. – Rocklan Feb 10 '15 at 03:53
  • 1
    This is by far the better answer. Starting Windows in SafeMode did not work for me (I still got the same error message). I believe that the McAfee installed on my work machine was causing the issue. The steps above worked best but as @Brettski pointed out, there is no need to rename the folder. Just delete the folders that are clearly the failed NuGet installations. – EL MOJO Feb 27 '15 at 19:01
  • 2
    Also works for Visual Studio 2013, but I merely had to rename the Extensions folder, then download and run the installation. When I did the install it re-created the Extensions folder with a single subfolder. I moved that subfolder into my renamed Extensions folder, deleted the new Extensions folder, then changed the name of my renamed Extensions folder back to "Extensions." Opened Visual Studio and was using the new version. – Tom Regan Jul 15 '15 at 17:11
  • I had this problem with VS2013 professional and while the installation said is was successful, the Extension folder was not recreated. I opened VS to see if that would create it but it didn't, and while it said nuget was installed, I was dubious. I found the vsix, in \program files(x86)\nuget\visual studio 2013\nuget.tools.vsix, re-ran it and then it created the folder for me. – Robin Coe Nov 24 '15 at 02:07
  • I also have McAfee installed at work (can't do anything about that) and this solution works for me with VS 2015 as well. One thing I noticed though is that in Visual Studio's Extensions and Updates window, NuGet Package Manager had "Automatically update this extension" checked. I don't remember doing this myself, I think it got checked by default, but unless you want to have to do this fix every couple of weeks you should uncheck this option. – Adam Goodwin May 02 '16 at 22:56
7

I'm using VS2010, I ended up fixing this problem by uninstalling NuGet Package Manager via the "Add Remove Programs", and then deleting this directory:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\Nuget Package Manager

I could then run the NuGet.Tools.vsix thing ok.

Rocklan
  • 7,888
  • 3
  • 34
  • 49
  • Your solution worked for Visual Studio Premium 2013, but the path was C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE and several randomly named folders of NuGet files were deleted. – Josh Brown Apr 10 '15 at 18:23
1

I have VS 2013 Pro installed. What solved this problem for me was to restart into safe mode and re-install NuGet there.

You may also want to look into Adam D's post in the link below (the add-in was blocked by anti-malware software):

Can't Update or Uninstall NuGet Package Manager in VS2012

Community
  • 1
  • 1
Duanne
  • 734
  • 7
  • 14
0

I found a solution for this issue at - https://kc.mcafee.com/corporate/index?page=content&id=KB85636&snspd-1015&locale=en_GB&viewlocale=en_GB

Cause:

The Microsoft Visual Studio (VS) process devenv.exe must be excluded in the EEFF/FRP process exclusion registry key.

Solution: Users with this issue must contact Intel Security Technical Support and quote this article number for assistance with adding the devenv.exe process to the correct EEFF/FRP process exclusion registry key.

rathish rk
  • 414
  • 4
  • 8