When you put an assembly into the GAC, you need to make sure that you never introduce breaking changes into that assembly. However, a particularly serious problem that arises is how the “no breaking changes” rule can severely limit your ability to innovate. Oftentimes when you want to innovate you can only do so by introducing breaking changes (just ask someone on the Windows team about how hard it is to innovate without introducing breaking changes).
So here’s another way of looking at whether you should have code in the GAC: is this code going to be stable for a long time? If the velocity of change in that code is going to be high, you are far better off deploying that code as private assemblies.
3 archived reader comments
Jon Flanders (2004-04-01)
But isn’t that sometime what is really wanted?
Going back to my custom control example - what if I am the Web Architect and I want to make sure that every Web Application on a machine (which in a large company may need to be in different applications due to requirements or just development) uses *my* header/footer/navigation control - and application are *forbidden* from changing them. In my experience this is often the case at large companies that are implementing ASP.NET.
John Lam (2004-04-01)
I agree with you that this is what is required in your scenario. You are effectively building a “platform” for the rest of your developers’ applications. You take the oath to not introduce breaking changes, and all is well.
However, in my experience, I find that far too many folks put all sorts of stuff that *changes* in their shared assemblies, and this introduces all sorts of breaking changes in dependent applications. This is particularly the case when there isn’t a well-defined release schedule for the “platform” code and the dependent code.
Jon Flanders (2004-04-01)
I think I agree with you more if you/we are talking about creating an API rather than implementing one. Hopefully that makes sense - impelementing a data access layer for example, versus deriving from Control or implementing IHttpModule.
In the former case I agree with you that you have to be extremely careful about not breaking your “interface” or implementation.
In the latter case, I think it is much safer (although certainly the “interface” is harder to break, the implementation can be hosed - to use a Canadian term ;-)).