Summary
This article discusses an In-Place Update of a .Net AssemblySynopsis
Like a standard Win32 file, an In-Place update (i.e. minor upgrade) of a .Net Framework assembly overwrites the file in its installed location, which for assemblies is likely in the Global Assembly Cache (GAC).
Discussion
In light of the GAC being the trusted global store for managed assemblies, the expressed opinion of the developers in the Microsoft Windows Installer team is, "don't." Or, that being said, at the very least try to avoid it. However, with valid reasons to replace a file and overwrite it with the new copy, this is supported functionality of the .Net Framework since version 1.1 SP1. In the MsiAssemblyName table, it is the value in the FileVersion field which should be changed. The strong name of the assembly is not changed in this method of updating the assembly.
It should also be understood that based on the assembly type, MSI delegates the responsibility for the installation and removal of assemblies to Fusion or SXS and does not handle it directly.
The discussion of implementing an in-place update is taken from a blog posting made by Heath Stewart of the Microsoft Windows Installer team:
To configure your product installed using Windows Installer to update assemblies in-place, you need to add or update your MsiAssemblyName table to include a FileVersion property with the new file version - not the assembly version, which must remain the same to update the old assembly in-place - of the assembly. Consider, for example, updating managed assembly Foo.dll with assembly version 1.0.0.0 and file version now 1.0.100.0:
| Component_ | Feature_ | File_Manifest | File_Application Attributes |
| C_FOO_DLL_GAC | DefaultFeature | FOO_DLL_GAC | 0 |
| Component_ | Name | Value |
| C_FOO_DLL_GAC | Name | Foo |
| C_FOO_DLL_GAC | Version | 1.0.0.0 |
| C_FOO_DLL_GAC | Culture | neutral |
| C_FOO_DLL_GAC | PublicKeyToken | 0123456789ABCDEF |
| C_FOO_DLL_GAC | FileVersion | 1.0.100.0 |
With no data in the File_Application column of the MsiAssembly table, the assembly will be installed into the GAC. With a different FileVersion property value, MSI will cause Fusion to overwrite the old assembly with the same strong name with the new one.
Additional Information
Additional information regarding updating .Net Assemblies can be found in the following articles:
- Updating Assemblies
- Heath Stewart's Blog - Updating Assemblies In-place with MSI
- Windows Installer Team Blog - Most frequent problem with the msi-fusion interaction? Incorrect authoring of strong name
- Insights into the underlying Windows Installer reboot behavior - look for the quesiton How are global assemblies treated differently than normal win32 files?
- Global Assembly Cache
- Installation of Win32 Assemblies
- Unmanaged API Reference - see reference to Fusion (Unmanaged)
- Installing Win32 Assemblies for Side-by-Side Sharing on Windows XP
Related Articles
Installation Fails for COM+ Application That Has a Shared .NET Assembly or a Dependency of a Shared .NET Assembly Being In… 4Number of Views Troubleshooting .NET Assembly Installation Issues 7Number of Views Autofill .NET Assembly Properties 5Number of Views Specify the Version of .NET Framework for .NET Precompile Assembly 7Number of Views HOTFIX: Install Fails With Error 1001 When a .NET Installer Class Component is Present in InstallShield 2015 SP1 17Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago