Home: NuGet package install gets 'process cannot access the file because it is in used by another process'

Created on 7 Aug 2015  Â·  32Comments  Â·  Source: NuGet/Home

VS 2013 or VS 2015. Having been getting this in VS 2013 for a while, but just installed VS 2015 and still getting the error.

Here is the installer log:

8/7/2015 11:09:41 AM - Microsoft VSIX Installer
8/7/2015 11:09:41 AM - -------------------------------------------
8/7/2015 11:09:41 AM - Initializing Install...
8/7/2015 11:09:41 AM - Extension Details...
8/7/2015 11:09:41 AM - Identifier : NuGet.67e54e40-0ae3-42c5-a949-fddf5739e6a5
8/7/2015 11:09:41 AM - Name : NuGet Package Manager for Visual Studio 2013
8/7/2015 11:09:41 AM - Author : Microsoft Corporation
8/7/2015 11:09:41 AM - Version : 2.8.60723.765
8/7/2015 11:09:41 AM - Description : A collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project.
8/7/2015 11:09:41 AM - Locale : en-US
8/7/2015 11:09:41 AM - MoreInfoURL : http://docs.nuget.org/
8/7/2015 11:09:41 AM - InstalledByMSI : False
8/7/2015 11:09:41 AM - SupportedFrameworkVersionRange : [4.0,4.5]
8/7/2015 11:09:41 AM -
8/7/2015 11:09:42 AM - SignedBy : Microsoft Corporation
8/7/2015 11:09:42 AM - Certificate Info : [Subject]
CN=Microsoft Corporation, OU=MOPR, OU=OPC, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

[Issuer]
CN=Microsoft Code Signing PCA, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

[Serial Number]
33000000FEEB02CCACAAEB9F780001000000FE

[Not Before]
5/20/2015 10:30:50 AM

[Not After]
8/20/2016 10:30:50 AM

[Thumbprint]
3FF2B5272DA04778A97B10E39F2AE1774ABF0E25

8/7/2015 11:09:42 AM - Supported Products :
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.Pro
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.IntegratedShell
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.VWDExpress
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.VPDExpress
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.VSWinExpress
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM - Microsoft.VisualStudio.VSWinDesktopExpress
8/7/2015 11:09:42 AM - Version : [12.0]
8/7/2015 11:09:42 AM -
8/7/2015 11:09:42 AM - References :
8/7/2015 11:09:42 AM -
8/7/2015 11:09:42 AM - Searching for applicable products...
8/7/2015 11:09:42 AM - Found installed product - Microsoft Visual Studio 2012 Shell (Integrated)
8/7/2015 11:09:42 AM - Found installed product - Microsoft Visual Studio Premium 2013
8/7/2015 11:09:43 AM - The extension will be upgraded from version 2.8.60318.734.
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio Professional 2013
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio 2013 Shell (Integrated)
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio Enterprise 2015
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio Professional 2015
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio Community 2015
8/7/2015 11:09:43 AM - Found installed product - Microsoft Visual Studio 2015 Shell (Integrated)
8/7/2015 11:09:43 AM - Found installed product - Global Location
8/7/2015 11:09:43 AM - Found installed product - ssms
8/7/2015 11:09:45 AM - The following target products have been selected...
8/7/2015 11:09:45 AM - Microsoft Visual Studio Premium 2013
8/7/2015 11:09:45 AM -
8/7/2015 11:09:46 AM - Beginning to install extension to Microsoft Visual Studio Premium 2013 ...
8/7/2015 11:09:46 AM - Upgrading 'NuGet Package Manager for Visual Studio 2013', version 2.8.60318.734 to version 2.8.60723.765.
8/7/2015 11:09:47 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.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)

I have tried doing a clean boot/powerdown and doing the install straight from here https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca, but get the same error.

Cliff

External

Most helpful comment

I had the issue on two machines. On the simplest scenario it was a clean build, with Windows 2012 R2, Visual Studio 2015, SQL Server 2014, iTunes, Chrome and Notepad++ as the only applications installed. Attempting to upgrade NuGet was the first thing I did after installing visual studio. There was no antivirus or similar installed on the server. My log file looks the same as that posted above.

If I 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, I don't get any errors about files being in use while deleting.

I can then start visual studio and download and install Nuget from the Extensions gallery successfully.

All 32 comments

Looks like you might have another program running at startup holding on to files. Is that something you can look into?

If not can you provide us with more details on what is installed on your machine, what OS are you using, etc?

@czfq2b still waiting on more information to investigate this issue

8/25/2015 9:19:11 AM - Microsoft VSIX Installer
8/25/2015 9:19:11 AM - -------------------------------------------
8/25/2015 9:19:11 AM - Initializing Install...
8/25/2015 9:19:12 AM - Extension Details...
8/25/2015 9:19:12 AM - Identifier : NuGet.0d421874-a3b2-4f67-b53a-ecfce878063b
8/25/2015 9:19:12 AM - Name : NuGet Package Manager for Visual Studio 2015
8/25/2015 9:19:12 AM - Author : Microsoft Corporation
8/25/2015 9:19:12 AM - Version : 3.1.60724.766
8/25/2015 9:19:12 AM - Description : A collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project.
8/25/2015 9:19:12 AM - Locale : en-US
8/25/2015 9:19:12 AM - MoreInfoURL :
8/25/2015 9:19:12 AM - InstalledByMSI : False
8/25/2015 9:19:12 AM - SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
8/25/2015 9:19:12 AM -
8/25/2015 9:19:13 AM - Supported Products :
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.Pro
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.Community
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.VWDExpress
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.VPDExpress
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.VSWinExpress
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM - Microsoft.VisualStudio.VSWinDesktopExpress
8/25/2015 9:19:13 AM - Version : [14.0]
8/25/2015 9:19:13 AM -
8/25/2015 9:19:13 AM - References :
8/25/2015 9:19:13 AM -
8/25/2015 9:19:36 AM - The extension will be upgraded from version 3.0.60624.657.
8/25/2015 9:20:29 AM - The following target products have been selected...
8/25/2015 9:20:29 AM - Microsoft Visual Studio Enterprise 2015
8/25/2015 9:20:29 AM -
8/25/2015 9:20:30 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2015...
8/25/2015 9:20:30 AM - Upgrading 'NuGet Package Manager for Visual Studio 2015', version 3.0.60624.657 to version 3.1.60724.766.
8/25/2015 9:20:41 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.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)

From: Yishai Galatzer [mailto:[email protected]]
Sent: Tuesday, August 18, 2015 3:14 PM
To: NuGet/Home [email protected]
Cc: Gleason, Cliff (Phoenix) Cliff.[email protected]
Subject: Re: [Home] NuGet package install gets 'process cannot access the file because it is in used by another process' (#1138)

@czfq2bhttps://github.com/czfq2b still waiting on more information to investigate this issue

—
Reply to this email directly or view it on GitHubhttps://github.com/NuGet/Home/issues/1138#issuecomment-132371882.

I had the issue on two machines. On the simplest scenario it was a clean build, with Windows 2012 R2, Visual Studio 2015, SQL Server 2014, iTunes, Chrome and Notepad++ as the only applications installed. Attempting to upgrade NuGet was the first thing I did after installing visual studio. There was no antivirus or similar installed on the server. My log file looks the same as that posted above.

If I 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, I don't get any errors about files being in use while deleting.

I can then start visual studio and download and install Nuget from the Extensions gallery successfully.

installed

I'm glad just not me has the issue. By what is installed on my machine, I'm assuming you mean relating to the IDE, as otherwise the list would be pages. It is attached.

@czfq2b can you try the work around that @paulhickman-a365 has suggested?

This didn't work for me, In fact VS 2015 is now trashed and I am repairing it. :8ball:

Is it possible to find out what file is being locked? This doesn't seem to be a nuget proper issue, and we would like to communicate to the visual studio folks what is going on.

You can use a tool like procmon to find out which file is locked.

Can you give me somewhere to send the process mon file, I don't see anything obvious and don't really know how to read it, and it won't let me upload any type of non-pic file.

Cliff

y i g a l a t z @ microsoft. com

I followed the steps in the following blog to resolve a similar issue. Removing the Nuget Packages I think ultimately was the resolution and getting the package manager using Visual Studio.

https://bensdigital.wordpress.com/2015/08/06/upgrading-nuget-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process-vs2015/

Talking to the vs extensibility folks, there is one extra step to try, which is to launch VS as an admin. Launching VS as admin will clear the extra nuget folders. It can't clear them right now because the extensions is installed for all users and requires admin credentials.

Thanks, those steps worked, but now I get the same error on the next extension I try to install (GitHub).

Starting it in Admin mode made no difference, same IO some file in use error.

Thanks for your time.

Cliff

@czfq2b I'm forwarding this over to the VSIX owners. Looks like there is something systematic in their part of the code.

great stuff janmchan, the steps worked like a charm

yishaigalatzer: is there any public bug tracker where we can track the VSIX issue?

I'm keeping this issue open until Visual Studio extensibility team resolves it, but there is not much to do in NuGet proper. Parking in the vNext milestone, until it gets resolved

Change permissons on the root of the folder to give everyone full control. This sorted it for me. Then you can change back after install if you want. Thanks

Changing permissions didn't work for me.

I searched for "nuget" in the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ and delete the four subfolders it found. Ran the VSIX installer without opening Visual Studio. Install worked. Did the same thing and it worked for another extension for PowerShell tools in Visual Studio which was failing in the same way. Some procedure worked last time I had to do this in the fall.

Verified workaround: I found all the folders in the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions folder which contained a .vsixmanifest file with an <Identity Id="{some-package-id}" element and removed those folders manually (just copied to my desktop incase it blows up). Then opened VS in admin and installed it again through the UI.

Paulhickman's solution worked for me, thank you!!!

Hi I have tried all of the above points and advices but i am still having the same issue. is there any other suggestion. i have tried reinstall vs2015 but no luck.

Please try and install update 2.

sorry I forgot to tell that I am trying to install vs20015 profession with update 2

Link provided by janmchan commented on Oct 26, 2015 worked.

We identified this as a bug or issue in the core visual studio extensibility. It is not a nuget specific issue, the team is working on getting repros and improve. It is generally tied to things like anti virus or encryption services.

just got this issue while updating nuget in vs2013

1 year later, same bug again but this time with VS2015 ... come on guys !

I have two .sln files in the same folder but I get this issue frequently as a result. Is there and way to make the two .sln files use different nuget folders so I don't get the file handles locked up?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philippe-lavoie picture philippe-lavoie  Â·  3Comments

livarcocc picture livarcocc  Â·  3Comments

skofman1 picture skofman1  Â·  3Comments

augustoproiete picture augustoproiete  Â·  3Comments

jainaashish picture jainaashish  Â·  3Comments