In the C # exception handler, can I find the parameters that were passed to the method that caused the exception?

I am writing an error handling module for a rather complex system created in the form of layers. Sometimes our data layer throws hidden exceptions.

It would be very convenient to print the values method parameters that raised the exception.

I can think about the TargetSite property of the exception to find the types and names of the method parameters, but it seems I can not get the values ​​... Am I missing something?


Dupe

In .net exception, how to get stacktrace with argument values

+5
source share
2 answers

... . . .

+2

ArgumentOutOfRangeException ( , ... ... , ... , ctor...

throw new ArgumentOutOfRangeException(string parameterName, 
           object actualValue, string message);

, , , ,

+3

All Articles