I would like to modify some methods of my dll by adding boundary aspects to that i.e. add a method calls OnEnter and OnExit (coming from separate class - the aspect class).
I have following questions how to accomplish that:
1. As I've seen from some examples you need to implement you own MetadataWriter class and then the Rewrite method. However for this purpose do I need to also create specialized implementation for ILRewriter class?
2. How should I add a new local variable (the aspect object) to the existing method. Should I use IlGenerator.AddVariableToCurrentScope or should I manipulate the LocalVariables collection in the MethodBody class?
Thanks for any help with those questions.