Updating a package fails because packages.config is in use by another process

Topics: General
Mar 13, 2015 at 4:49 PM
Visual Studio 2013 Ultimate with Update 4
NuGet Package Manager for Visual Studio version 2.8.50926.663
Automatic package restore in use

I frequently see errors in both the VS package manager UI AND the package manager console when updating a package across all projects in a solution.

Updating 'Company.Commons' from version '1.0.41202.2' to '' in project 'WebHost'.
Removing 'Company.Commons 1.0.41202.2' from WebHost.
Successfully removed 'Company.Commons 1.0.41202.2' from WebHost.
Adding 'Company.Commons' to WebHost.
Update-Package : The process cannot access the file 'D:\dev...\WebHost\packages.config' because it is being used by another process.
At line:1 char:1
  • Update-Package Company.Commons
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Update-Package], Exception
    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.UpdatePackageCommand
The frustrating thing is occasionally it works.
Of course, this only happens on my machine...
Apr 16, 2015 at 7:19 PM

I also have this problems with VS2013. In my case, suspending Resharper does the job: