Signed Assemblies vs. Instrumentation: Fight of the century.

Microsoft allows you to ‘sign’ .Net Assemblies, enabling certain security & verification functionality ( CAS ). When you sign an assembly, .NET can automcatially detect if the assembly has been altered since it has been sign, thereby providing some extra security to running code.

The problem comes in when you introduce instrumentation. For those who don’t know, instrumentation is the weaving of new code into existing code, usually post-compile. It’s used for a multitude of things, including profiling, AOP, and creating dynamic proxies.

Obviously, this instrumentation changes the assembly, thereby breaking the signature. What’s one to do?

Well, Ian ( in addition to having a great blog tagline ) has just blogged about solving one of the above problems, profiling signed assemblies. Granted, it’s only for VSTS 2005, but it’s a start.

Check it out.

P.S. ‘instrumentation’ was possibly the toughest word to keep spelling over and over again, so I am sure I killed it at least once above.