Hi guys
Is there a way how to can I access a stact in my programm? More specificaly - I want to walk trought the stack to obtaine a caller of method I am actualy executing. And caller of it and so on. Like in debugger Call Stack window, but without debuging.
Thanks.

1 answers
I hope the requirement is for error logging. If so, I think you can get the Server.GetLastError() and from which you can get the instance of teh methodbase class using the targetsite property and you can get the assembly, namespace, class and method in which the exception is occured.
If it is not for exception logging, then I think you can simply create an instance of StackTrace object which is in System.Diagnosistics namesapce and can access all the frames of that, which will give the informations.
Hope this helps....
Thanks.
Gerald Leslie
answered 2 years ago by:
0
The StackTrace is the class I was looking for. Thanks.
answered 2 years ago by:
0
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!