[Mono-list] Re: StackTrace implementation?

Lawrence Pit loz@cable.a2000.nl
Wed, 22 May 2002 22:16:03 +0300


> > + public static string StackTrace {
> > + get {
> > + try {
> > + throw new Exception ();
> > + } catch (Exception e) {
> > + return e.StackTrace;
> > + }
> >  }
> >  }
>
> AFAIK this will always create a trace with only one frame, namely the
> "public static string StackTrace" frame itself. Please can you verify
> that this produces the right result, compatible with the Microsoft
> implementation?

Hi Dietmar,

just tested in ms.net, and you're right, it doesn't actually produce what
I'd expect (I'm too brainwashed by Java stacktraces I guess ;). The
documentation of Exception.StackTrace is not quite clear about this though
imo, based on that I'd still expect a trace of "all the method calls".



Greets,
Lawrence