Question

I am talking about those Code Contracts that will end up in .NET 4.0. What binary rewriter do they use to inject the code that makes it all work and is it publicly available? I hope it's not just a compiler thing because I would love to be able to use their binary rewriter for AOP.

Was it helpful?

Solution

If you want to write your own AOP, or anything else that modifies IL you may want to look at MS Research's Common Compiler Infrastructure project on Codeplex . It is an open source bag of really great tools that provides both an IL reader and IL writer implementation.

Jason Bock also has a series of blog posts on Code Injection With CCI that give a good overview of implementing an AOP style assembly modification with the tools.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top