Reputation:
This is what i intend to do:
What is the best way to approach this?
I am thinking of writing a abstract class which will derive from postsharp method execution aspect. Then i will have another dll which will have a NLog specific implementation... so it will have a class which will derive from the general method execution aspect class i have created in the general dll.
The consuming code will only reference the general class dll i have written, and that class will doa load of NLog specific dll i have written if that is what is specified in the application config.
makes sense?
Upvotes: 2
Views: 971
Reputation: 6857
I think you are on the right track. However, try using OnMethodBoundaryAspect instead. It is faster at runtime than OnMethodInvocationAspect.
Try to take advantage of compile-time initialization (CompileTimeInitialize) and run-time initialization (RunTimeInitialize) and avoid doing anything costly in handlers.
Upvotes: 3