Microsoft Knowledge Base Email Alertz

Patching of Microsoft Framework can fail with Access is denied or File in Use error

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 2263996 - Last Review: August 25, 2011 - Revision: 7.0

Patching of Microsoft Framework can fail with Access is denied or File in Use error

SYMPTOMS

If an assembly file in the GAC (Global Access Cache) has been locked or is "in use" it can cause .NET Framework patches to fail. This problem can be exacerbated by a bug in the way fusion handles the rollback and can cause files to be deleted. This will result in managed applications (those applications that depend on framework assemblies) to fail. For more information, visit the following Microsoft Website:
2260913 Files in use or File Locks can Result in Framework Assembly Files being deleted
The failing patch MSI Verbose log might contain something like this:

>>
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\system.dll' because of system error: Access is denied.

06/22/10 11:57:26 DDSet_Status: Sleeping 100ms...
MSI (s) (54!70) [11:57:26:738]: Product: Microsoft .NET Framework 2.0 Service Pack 2 -- There is a problem with this Windows Installer package. Please refer to the setup log for more information.
There is a problem with this Windows Installer package. Please refer to the setup log for more information.
06/22/10 11:57:26 DDSet_CARetVal: 0
06/22/10 11:57:26 DDSet_Exit: InstallAssembly ended with return value 1603
MSI (s) (54:94) [11:57:26:758]: User policy value 'DisableRollback' is 0
MSI (s) (54:94) [11:57:26:758]: Machine policy value 'DisableRollback' is 0
Action ended 11:57:26: InstallExecute. Return value 3.
<<

Or

>>
02/22/10 08:38:32 DDSet_Status: Sleeping 100ms...
02/22/10 08:38:32 DDSet_Error: Failed to install assembly C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll. IAssemblyCache->InstallAssembly() returned -2147024864.
02/22/10 08:38:32 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: The process cannot access the file because it is being used by another process.
<<

CAUSE

If assemblies are "in use" or locked when a patch is applied, the patch will fail.

RESOLUTION

This problem can be avoided by ensuring processes are not running that can put a lock on the assemblies.

To detect whether assemblies are being used, follow these steps:
  1. Download procexp.exe (http://live.sysinternals.com/procexp.exe) to discover process that are locking assemblies.
  2. Launch procexp.exe and then press CTRL + F to open the Process Explorer Search window.
  3. In the Handle or DLL substring textbox, type Assembly and then click Search.
    Collapse this imageExpand this image
  4. All files listed could have an impact on the installation of the patch. Terminate all the listed processes or close the associated applications. To do this, follow these steps:
    1. Click the Process Name you want to terminate in the Process Explorer Search window to locate the process.
    2. Right click the Process Name in the Process pane.
    3. Click Kill Process to terminate the Process.

    Collapse this imageExpand this image

APPLIES TO
  • Microsoft .NET Framework 2.0
  • Microsoft .NET Framework 2.0 Service Pack 1 (x86)
  • Microsoft .NET Framework 2.0 Service Pack 2
  • Microsoft .NET Framework 3.0
  • Microsoft .NET Framework 3.0 Service Pack 1
  • Microsoft .NET Framework 3.0 Service Pack 2
  • Microsoft .NET Framework 3.5
  • Microsoft .NET Framework 3.5 Service Pack 1
Keywords: 
kbcip KB2263996
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate