In the examples on their website, PostSharp has a demo of intercepting calls in main system assemblies. I have tried a few times to setup and replicate said intercept calls on assemblies I don't have the source code for with no success.
My approach was to simply place the assembly level attribute targeting the namespace and method I wanted to instrument. This has never worked for me.
something like:
[assembly: Trace("MyCategory", AttributeTargetTypes = "My.BusinessLayer.*")]
Am I missing something here? Can I not do a runtime injection of my instrumentation aspect on a assembly if I don't have the source pulled in for it? I thought I could do runtime injections...
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…