Home All Groups Group Topic Archive Search About

Retrieve method name at runtime

Author
7 Mar 2007 1:15 PM
Patty
I need to retrieve the method name and parameters at runtime.
I used the System.Reflection.MethodBase.GetCurrentMethod() to do that, but
in two cases it returned me a System.argumentExecption. The message is:
Cannot evaluate a security function.
How can I do to solve this problem?

Thank's in advance.

Patty

Author
10 Mar 2007 1:54 AM
Patrick Steele
In article <8C52F427-9EBD-4766-8E35-773BB811C***@microsoft.com>,
Pa***@discussions.microsoft.com says...
> I need to retrieve the method name and parameters at runtime.
> I used the System.Reflection.MethodBase.GetCurrentMethod() to do that, but
> in two cases it returned me a System.argumentExecption. The message is:
> Cannot evaluate a security function.
> How can I do to solve this problem?

Sounds like it may be a permissions problem.  Are you running at full
trust?

Getting a method name uses reflection and isn't cheap -- if you use it a
lot it will affect performance.  Also, you won't be able to get
parameter values -- only the names.  I think you'll need to tap into the
debugger hooks using MC++ if you want to get values.


AddThis Social Bookmark Button