Prior to PostSharp 2.0, running an obfuscator on assemblies enhanced by PostSharp would almost certainly cause runtime issues. The reason, as Simon Cooper explains extensively in his blog, is that PostSharp includes textual references to methods, and these references are broken when the obfuscator renames these methods.
PostSharp 2.1 attempted to solve this limitation with a feature called “obfuscation awareness”, which emits additional data structures that could be parsed and re-written during or after the obfuscator. We implemented a post-obfuscation utility that fixed the obfuscated assembly – with initial support for the gorilla in the room: Dotfuscator. Quite frankly, we were quite disappointed by this effort, first because we’ve never received the kickback we hoped from Preemptive, then because the high price point of their product turned people away. Additionally, the post-obfuscation step caused additional friction. So, this feature was a semi failure. Up to now.
We’re thrilled to announce that the good folks at Red Gate have baked support for PostSharp right into SmartAssembly (>=6.6.4). No need for an additional build step, a sweeter price point, and a friendly relationship: we and our customers have many reasons to be satisfied!
Just remember to enable PostSharp obfuscation awareness in each project that requires it: