Interesting fusion GAC install bug


A friend of mine was investigating a strange bug this past week that exposed an interesting bug in fusion (the piece of the .NET Framework that is used to manage the Global Assembly Cache aka the GAC).  In this particular bug someone was trying to install the .NET Framework 1.1 on a Windows XP Media Center machine, and the .NET 1.1 setup ended up hanging.

The underlying reason for the hang was that this machine had a set of orphaned empty directories under %windir%\assembly\GAC (named like <assembly name>\<assembly version_strong name>) and the fusion code to install assemblies to the GAC had a bug where it would check for the existence of the directory that the file is expected to exist in within the GAC rather than checking that the file itself actually exists in that directory.  For each of the assemblies that we tried to install as part of the .NET Framework 1.1 setup, there was an entry like this in the verbose MSI log:

MSI (s) (C8:D8): skipping installation of assembly component: {45B8FB98-2A6C-11D6-A551-0090278A1BB8} since the assembly already exists

Then when .NET Framework 1.1 setup tried to run ngen.exe at the end of setup to generate native images, it would hang because the underlying assembly actually was not present in the GAC (which in itself is another bug - it should gracefully fail with an informative error instead of hanging).

My friend and his team are still trying to figure out why the orphaned directories exist on the machine in the first place.  It appears to be caused by performing an OS installation to a partition that previously had an OS installed to it without first performing a full format of that partition.

When my friend was telling me about this bug, it rang a bell for me from my past experience, so I dug through my email archive.  I ended up finding a problem that I helped an internal customer solve that had the exact same symptoms and that exposed the same bug in fusion.  So I wanted to go ahead and blog about this in case there are any setup developers or testers out there who are seeing odd behavior when trying to install assemblies to the GAC.

 

Comments (2)

  1. Windows Media Center Edition is the only machine we know with this failure. The fix is already in v1.0 SP3 and v1.1 SP1.

  2. From what I understand, Media Center is the only OS that we’ve seen the issue where a clean OS install to the same partition will result in empty directories in the GAC like this. I haven’t confirmed yet but I think the same issue would also affect Tablet PC, but it does not affect XP Home/Pro.

    The fusion bug where it uses the directory to determine whether or not it needs to install the assembly instead of the file itself should be OS-independent. Although it is much more unlikely that empty directories will be orphaned on other OS types, if they do happen to be there I think this bug should affect them too.

    I’m also glad to hear that this issue is fixed in 1.0 SP3 and 1.1 SP1 (and 2.0 as well).

Skip to main content