The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Maslovian (31) [Avatar] Offline
What I mean is, do you know of any methods that I don't have to decorate my classes with attributes, but instead define programmatic-ally places in a Aop assembly that I write which would recompile or weave into the target assembly?

If there's somewhere in the book I'm missing that, refer me to a page number? =)

matthew.groves (46) [Avatar] Offline
Re: Are there any AOP methods available to .net that aren't intrusive?
If you are using something like Castle DynamicProxy, then you can define in your IoC container where you want the aspects to be applied. I assume this isn't what you mean, since I do this in the book a lot, but I just thought I'd mention it first.

With PostSharp, you don't have to declare attributes at the class/method level every time: you can also declare them at the assembly level (I talk about this in chapters 8 and 9, and PostSharp documentation goes into a lot more detail).

If you are interested in applying aspects to other assemblies, then Dustin Davis has a video tutorial for this. Normally this applies to third-party assemblies that you don't have the source code for, but it might be an option for you. Also note that I don't think this is officially supported by PostSharp, but it does work:

Finally, if you check out a tool like Fody (I mention briefly in the appendix), some (not all) of its modules work via convention, not attribute.