Possible installation problems with .NET Framework 2.0, 3.0 and 3.5 hotfixes that can remove assemblies from the GAC

A couple of new knowledge base articles related to failed installations of .NET Framework 2.0, 3.0 and 3.5 hotfixes were published this week that I want to link to in order to hopefully help provide more visibility into the issues that they describe.  You can find the articles at the following locations:

Summary of the issue

To summarize the issues described in these knowledge base articles, hotfixes for the .NET Framework 2.0, 3.0 and 3.5 can fail to install if the hotfix attempts to update an assembly that is installed in the global assembly cache (GAC) and that assembly is held in use with a hard lock by another application running on the system.  To make matters worse, when a .NET Framework hotfix fails to install due to hard-locked files, the original file can end up being removed from the GAC entirely, which can cause .NET Framework applications to fail to run correctly on the system afterwards.

In general, hard locks are very rare and very few applications will load .NET Framework assemblies in a way that causes them to be hard-locked.  There is a tool described in this blog post that can be used to simulate hard locks if you need to test this type of scenario.

This issue only affects hotfixes for MSI-based versions of the .NET Framework (so it will not affect the .NET Framework 2.0 or 3.0 on Windows Vista or the .NET Framework 2.0, 3.0 or 3.5 on Windows 7 for example).

How to diagnose the issue

In this type of scenario, you may see an error that looks like the following in the verbose log file for the .NET Framework hotfix (the exact file name in the error message will vary depending on what hotfix you are installing and what files are hard-locked):

07/01/10 11:30:00 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.

07/01/10 11:30:00 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: Access is denied.

If any files are removed from the GAC during the failing .NET Framework hotfix installation, the .NET Framework setup verification tool will report that one or more files is missing from your system.

How to resolve the issue

If you encounter this error, you can resolve it by doing the following:

  1. Repair or uninstall + re-install the .NET Framework (using these steps if necessary)
  2. Make sure that any .NET Framework files are no longer in use by using the steps in this knowledge base article
  3. Attempt to install the .NET Framework hotfix again