Reflection & Parameter Values 
Author Message
 Reflection & Parameter Values

Hi,

I have retrieved a MethodInfo object and I'm trying to retrieve the actual
value that was passed into each parameter. This is for a generic error
logging routine so I need to read the value of each of the parameters as
well as the type. A message similar to this was posted in December but I
don't have it cached.

Any ideas on how to achieve this??

Thanks,
Brian



Fri, 31 Dec 2004 16:35:31 GMT  
 Reflection & Parameter Values
Brian,

    I don't understand how you would be able to do this, as if you are
making the call from somewhere else, then you won't have access to the
values on the stack of that call, and if you are making the call from within
the method that you want to access, then you know what the parameters are.

    The only way you would be able to get around this would be to tap into
the CLR and intercept the calls to the methods, taking note of the
parameters.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Quote:
> Hi,

> I have retrieved a MethodInfo object and I'm trying to retrieve the actual
> value that was passed into each parameter. This is for a generic error
> logging routine so I need to read the value of each of the parameters as
> well as the type. A message similar to this was posted in December but I
> don't have it cached.

> Any ideas on how to achieve this??

> Thanks,
> Brian



Fri, 31 Dec 2004 20:59:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to get parameter values via reflection

2. function parameters: default value, optional parameter

3. Interop Reflection and Optional parameters

4. Using reflection to set the value of an inline ValueType struct

5. Setting field values on forms using reflection

6. q: System.Reflection & indexers

7. Reflection & Invocation

8. Reflection & Namespace

9. Reflection & Delegates

10. Using Reflection to get the value of a parameter.

11. Method Output Parameter vs Return Value

12. template template parameter with default value (VS.NET 2003)

 

 
Powered by phpBB® Forum Software