Additional info about installing an assembly to the GAC and the local file system

I wrote this post a couple of months ago describing how to install an assembly to both the GAC and the local file system in the same MSI. Since then, I've been asked a couple of follow-up questions by folks who read my blog post and also by internal Microsoft setup developers. Here is an interesting question that I wanted to share. I helped out a developer who is using WiX to create their MSI. They initially created a single component with 2 copies of the file but the MSI could not be created. This is because Windows Installer does not allow you to install multiple assemblies in the same component (except in the rare case that you have a multi-module assembly). The developer then followed the guidelines of creating 2 separate components to install the file - one for the local file system and one for the GAC. The snippet of their WiX XML looks like this:

<Component Id="foo.dll" Guid="23C421A5-B2AA-415b-9359-B3CC2F46D155" DiskId="1">
<File
Id="foo.dll" KeyPath="yes"
Name="foo.DLL" LongName="foo.dll"
src="$(var.FileRoot)\foo.dll"
/>
</Component>
<Component Id="foo_GAC.dll" Guid="73205F15-F5D9-4EAE-A442-025B06B1ECBF" DiskId="1">
<File
Id="foo_GAC.dll" KeyPath="yes" Assembly=".net" ProcessorArchitecture="msil"
Name="foo.dll" LongName="foo.dll"
src="$(var.FileRoot)\foo.dll"
/>
</Component>

However, when the developer ran ICE validation on the resultant MSI, it came up with the following errors:

ICE30 ERROR The target file 'foo.dll|foo.dll' is installed in '[ProgramFilesFolder]My Folder\' by two different components on an LFN system: 'foo_GAC.dll.77A12173_4086_4E29_AEFF_562F22878D9A' and 'foo.dll.77A12173_4086_4E29_AEFF_562F22878D9A'. This breaks component reference counting.
ICE30 ERROR The target file 'foo.dll|foo.dll' is installed in '[ProgramFilesFolder]My Folder\' by two different components on an LFN system: 'foo_GAC.dll.77A12173_4086_4E29_AEFF_562F22878D9A' and 'foo.dll.77A12173_4086_4E29_AEFF_562F22878D9A'. This breaks component reference counting.

The problem ended up being that both components were authored to install to the same directory, which is a little misleading since the copy of the file that gets installed to the GAC does not actually get installed to the directory listed in the Component table of the MSI. The way that the Visual Studio MSI package handles this is to create a dummy directory named \GAC underneath the local directory that each duplicated assembly is installed to on the local file system. Then the GAC version of the component can be marked to "install" to that dummy directory, which will allow the ICE30 test to pass.