简体   繁体   English

Postsharp - 获取调用程序集?

[英]Postsharp - Get Calling Assembly?

When using a Postsharp OnMethodBoundaryAspect, is there some way to get the calling assembly that initiated the call to a given method?使用 Postsharp OnMethodBoundaryAspect 时,是否有某种方法可以获取发起对给定方法的调用的调用程序集? GetCallingAssembly just returns the assembly that the method being called is in. GetCallingAssembly 只返回被调用方法所在的程序集。

Note - I am having trouble with the postsharp forums, otherwise I would have posted it there.注意 - 我在 postsharp 论坛上遇到了问题,否则我会在那里发布它。

No;不; there is no way.不可能。

The only way is to walk the stack using System.Diagnostics.StackTrace.唯一的方法是使用 System.Diagnostics.StackTrace 遍历堆栈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM