To GAC or Not to GAC, and Which Assemblies?

Topics: Service Factory Modeling Edition Forum
Oct 14, 2008 at 2:16 PM
I had an interesting problem recently. It was one of those problems that was too interesting, if you know what I mean.

I was supposed to be creating screen shots of my customizations for a big presentation. To do this, I used a Virtual Machine that I have set up for just this purpose. I had last used it about a month earlier, so the first thing I did was uninstall the version of Service Factory it was running and installed the new version. But strange things started to happen. Some of my more recent changes were present, but others were not. I didn't see a pattern until one exception I received made reference to an enumeration value of SeviceFactoryRoleType that I had removed. I took that as a hint.

I checked the deployed binary, and it did not have the removed enumeration member. Yet the exception continued to reference the removed member. So, if it's not loading the assembly without the member, yet is loading an assembly with the member, then it must be loading a different assembly with the member.

Sure enough, the Microsoft.Practices.Modeling.CodeGeneration assembly that contains the type I modified was in the GAC. Apparently, since I hadn't been changing version numbers, it was still in the GAC, from some months prior. All of my non-binary modifications, and most of my binary modifications, were successfully being used, but not the code that was loaded into the GAC months before and not replaced since.

  1. Is there a specific set of assemblies that will be placed in the GAC? If so, then please document them.
  2. Should these assemblies be updated when we do an install?
  3. Should they be updated because we change the version number when we customize, and if so, then in what way must hte version number change in order for the assembly to be updated in the GAC upon installation of a new version?
  4. Or, as in my previous discussion thread, maybe we should only be customizing Microsoft.Practices.ServiceFactory.* code?

Thanks for any opinions on this.