reflection question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PJ6

    #1

    reflection question

    Can't find this in the docs - how do you discover from the content of the
    stack trace what paramater values were fed to a method in a particular
    frame?

    Paul


  • Mattias Sjögren

    #2
    Re: reflection question

    >Can't find this in the docs - how do you discover from the content of the
    >stack trace what paramater values were fed to a method in a particular
    >frame?
    You can't get parameter values with Reflection.


    Mattias

    --
    Mattias Sjögren [C# MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    • Phill W.

      #3
      Re: reflection question

      PJ6 wrote:
      Can't find this in the docs
      Because it's not there.
      how do you discover from the content of the stack trace what paramater
      values were fed to a method in a particular frame?
      Can't be done.

      By the time the Stack Trace is caught in an Exception Handling routine,
      the values themselves, most likely, are long dead and gone.

      To me, this is one of the most frustrating things about .Net's Exception
      Handling. I've even gone as far as creating my own "tracking" class
      which I use to instrument the entry and exit - *with* parameters and
      return values - to/from my methods. Yes, there's a sizable overhead in
      doing this but, as I think you've discovered, just knowing /where/
      something failed /isn't/ enough to start solving the problem.
      (And I hate Line Numbers, too, for the same reason).

      "Bad" Code /breaks/.
      "Good" Code /gets broken/, by Bad Data.

      And what's missing from the Exception StackTrace? The data that caused
      the failure.

      Regards,
      Phill W.

      Comment

      Working...