Microsoft KB Archive/905238

= An assembly in the global assembly cache is missing after you perform a major upgrade by using a Windows Installer package =

Article ID: 905238

Article Last Modified on 3/2/2007

-

APPLIES TO


 * Microsoft Windows Installer 3.1
 * Microsoft Windows Installer 3.0
 * Microsoft Windows Installer 2.0

-





SYMPTOMS
After you perform a major upgrade by using a Microsoft Windows Installer package, an assembly in the global assembly cache is missing.



CAUSE
This problem occurs when the Windows Installer RemoveExistingProducts action is sequenced in a location that prevents appropriate reference counting of the assembly and that causes the premature removal of the assembly. The RemoveExistingProducts action is sequenced in the InstallExecuteSequence table in the Windows Installer package. This problem occurs when the RemoveExistingProducts action is sequenced so that the old product is removed before the new product is installed.

When an assembly is put into the global assembly cache, the assembly is renamed. Windows Installer cannot determine the correct name of the assembly. Windows Installer must rely on the Microsoft .NET Framework to manage the name.

When you perform a major upgrade by using a Windows Installer package, Windows Installer calls into the .NET Framework to test whether the assembly is already installed in the global assembly cache. If the .NET Framework returns yes, the component that contains the assembly in the major upgrade Windows Installer package is not allowed for installation. Next, the RemoveExistingProducts action runs and uninstalls the existing assembly in the global assembly cache. The RemoveExistingProducts action does this because the new product has not been registered as a client of the assembly and no other clients exist. Because the component in the major upgrade was not allowed for installation, the assembly is not reinstalled when the major upgrade installs the components.

If you resequence the RemoveExistingProducts action to schedule uninstallation of the old product after the new product is installed, the assembly will not be removed. The assembly will not be removed because the assembly now has an additional reference count from the new product. Therefore, even though the installation of the assembly is skipped for the major upgrade, the assembly still remains because another client references the assembly. The new product and the old product reference the assembly.

Note When an assembly is not located in the global assembly cache, no renaming occurs. The standard Windows Installer file versioning rules apply, and the component in the major upgrade is allowed for installation.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
Increase the AssemblyVersion attribute of the assembly that you are trying to install to create a side-by-side installation in the global assembly cache.

Method 2
Use a Windows Installer table-authoring tool to change the sequencing of the RemoveExistingProducts action in the InstallExecuteSequence table to occur after the InstallFinalize action. For example, use the Orca.exe database table editor for creating or editing Windows Installer packages.



MORE INFORMATION
You can create a Windows Installer package in a Setup and Deployment Projects project in Microsoft Visual Studio .NET. When the RemoveExistingProducts action is sequenced in this Windows Installer package, the default location of the RemoveExistingProducts action in the InstallExecuteSequence table causes the problem that is described in the &quot;Symptoms&quot; section.

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:

Windows Installer

http://msdn2.microsoft.com/en-us/library/aa372866.aspx

RemoveExistingProducts action

http://msdn2.microsoft.com/en-us/library/aa371197.aspx

InstallExecuteSequence table

http://msdn2.microsoft.com/en-us/library/aa369500.aspx

Orca.exe

http://msdn2.microsoft.com/en-us/library/aa370557.aspx

Additional query words: MSI

Keywords: kbwindowsinstaller kbinfo kbtshoot kbprb KB905238

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.