1
votes

We have an assembly xyz in our GAC with version 1.0.0.0. We need to replace it with the another version of this assembly which has the same version 1.0.0.0 but the File version has been bumped up to 1.0.1.0. This is based on suggestion for a question

However, when I created the installer, it runs successfully but the assembly does not gets replaced. What should I do to force the installer to replace the existing assembly with the new one?

EDIT : I had read elsewhere that the GAC goes by AssemblyFileVersion and a difference in that should trigger the replacement in the GAC but it does not seem to be working.

EDIT : Can the gurus out there tell me what does the installer go by when it replaces a dll? Is it the AssemblyFileVersion or the AssemblyVersion? I have read conflicting statements on this.

1
you first have to uninstall assembly from GAC then run installer.Student
Or you could just bump up the assembly version, too.vcsjones
@Student : Can this be done via the installer?koobi
@vcsjones : Unfortunately we need to maintain the Assembly Version Number or else we would have to rebuild all the apps using this assembly.koobi
The solution I see is to remove the old assembly by launching gacutil.exe through a custom action. After that your package can install the updated version.rmrrm

1 Answers

2
votes

When the Assembly Version is a tie, then the Assembly File Version is used. I've been using this stategy successfully for several years at my current employer. My suggestion is to run gacutil manually to see the behaviour for yourself.

Your problem must lie in your installer that you have created to run gacutil. The installer will have it's own file overwrite rules (nothing to do with the GAC). Also, perhaps you are not actaully running gacutil from your installer correctly.