tags:

views:

194

answers:

1

When using a Postsharp OnMethodBoundaryAspect, is there some way to get the calling assembly that initiated the call to a given method? GetCallingAssembly just returns the assembly that the method being called is in.

Note - I am having trouble with the postsharp forums, otherwise I would have posted it there.

A: 

No; there is no way.

The only way is to walk the stack using System.Diagnostics.StackTrace.

-gael

Gael Fraiteur
Ouch, don't want to do that. Okay, thanks.
But what is your problem with the PostSharp forum? Nobody complains any more, so i guess it's more or less stable...
Gael Fraiteur
Walking through the stack is not such a pain: http://geekswithblogs.net/alternativedotnet/archive/2006/02/04/68162.aspx, Check the GetCallingAssemblies() method impementation.
Groo
No pain, but a performance burden...
Gael Fraiteur