.NET 4 assembly is not removed from GAC on uninstallation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

chriswatson
Posts: 7
Joined: Thu Nov 10, 2011 2:18 pm

.NET 4 assembly is not removed from GAC on uninstallation

I have a fairly straight forward installer which installs an assembly (targeting .NET Framework 4) in the Global Assembly Cache and registers the assembly for COM interop.

Everything works as expected apart from when the product is uninstalled. The directory created in the GAC for the assembly, and the assembly itself, remain and are not removed after the uninstallation is performed.

The directory which is created (and never removed) containing the expected Advantage.Application.dll file is

Code: Select all

C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\Advantage.Application\v4.0_1.9.0.0__a512278c560dba63
I have tried installing and uninstalling the product rebooting between each step to see if the removal was being scheduled for the next boot but this made no difference.

The version of Advanced Installer used to create the installer is 8.5 build 38139.
The behaviour was observed running the installer on Windows XP SP3.

I can supply both the *.aip project file or the compiled *.msi file if required.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hello and welcome to Advanced Installer forums,

Does this behavior manifest on other Windows XP SP3 clean machines or on machines with different OS or architecture?

Please keep in mind that some assemblies require certain attributes to be specified in order to be uninstalled. Also, the resources this assembly uses may be referenced by other installers or in another section of your project.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chriswatson
Posts: 7
Joined: Thu Nov 10, 2011 2:18 pm

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Mihai,

I originally observed the behaviour on my development machine, I reproduced the behaviour on a VM (also running Windows XP SP3) I use for testing which I consider relatively clean - it is configured as a standard desktop for users in our organisation. I don't have ready access to any other platforms.

Which attributes are you referring to? I've checked those on the Resources > Assemblies panel for the assembly in question and they appear to be complete. I've attached a screenshot of same - note that while the Version attribute has a value of 0.0.0.0 it does have the "Synchronize value with the assembly file" option checked.

Image

I'm almost certain that no other installers reference this assembly - it certainly doesn't exist in the GAC before the installer we're talking about here is run - which is what I assume you're alluding to here, some kind of reference count that is keeping the assembly in place?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Chris,

The most common scenario for a skipped resource during uninstall for Windows Installer is when its shared by multiple applications,
this is often met for assemblies, this why Mihai suggested to check it.

Since you want the assembly only for your application, have you considered a private install, i.e. the option "Private Install to:" from Assemblies page?

Also, to get more details on the reason used by Windows Installer to skip its removal can you please create a verbose log and send it to support at advancedinstaller dot com so we can analyze it?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chriswatson
Posts: 7
Joined: Thu Nov 10, 2011 2:18 pm

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Bogdan,

The primary purpose for the installer is to install the assembly for consumption by a website running on Classic ASP using COM interop. Since the COM registrations are system wide, I want the assembly to be available system wide.

In the future I might want to use the same installer to deploy this assembly to our desktops for use from other applications - again using COM interop.

For these reasons I don't want to use a private assembly.

I also want to understand why the assembly is not being removed.

I have created the log files you have requested and emailed them.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Chris,

It seems the problem you are experiencing is one quite popular for assemblies, i.e. an incorrect authoring of strong name. More details on this you can find here:
http://blogs.msdn.com/b/windows_install ... 73320.aspx

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chriswatson
Posts: 7
Joined: Thu Nov 10, 2011 2:18 pm

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Bogdan,

Thank you for the interesting link. I opened the compiled MSI in Orca and examined the tables mentioned in the article. The record in the File table for the Advantage.Application.dll file had the expected value for the Version field of "1.9.0.0" (screenshot). The Version record in the MsiAssemblyName table for the Advantage.Application.dll assembly had an incorrect value of "0.0.0.0" (screenshot).

I edited the Version record in the MsiAssemblyName table to set the Value field to "1.9.0.0" and tried installing and then uninstalling the product; the assembly was removed from the GAC.

I revisited the assembly attributes that Mihai referred to previously to double check that I have configured the Version attribute correctly. As I explained before I have it set to "0.0.0.0" but have enabled the "Synchronize value with the assembly file" option (screenshot). This is a pattern I have successfully used before - the synchronize option means I don't have to remember to update it, and the 0.0.0.0 is a visual clue to myself that I don't have to.

In this project this does not seem to be working; whatever value is typed in is written to the MSI, the correct value is not obtained from the assembly.

I have installed the trial version of Advanced Installer 8.5 on a colleagues machine and reproduced this behaviour. I then updated this installation to the current version (8.6) and again reproduced the behaviour.

In case it is significant, the previous installers I have created using this option were to deploy assemblies targeting .NET Framework 3.5, this is the first time I have used Advanced Installer to deploy an assembly targeting .NET Framework 4.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Hi Chris,

Indeed, it seems the synchronization fails to get the correct information from the assembly. Thank you for bringing this to our attention, a fix shall be included as soon as possible, version 8.7 might not include it as its almost ready for release.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chriswatson
Posts: 7
Joined: Thu Nov 10, 2011 2:18 pm

Re: .NET 4 assembly is not removed from GAC on uninstallatio

Thank you Bogdan and Mihai for your help with this issue.

I anticipate the release of v8.8 so that I may build corrected versions of our affected installation packages.

Return to “Common Problems”