Solution 2 by Mika Wendelius points to a very powerful tool.
At the same time, for most everyday chores, there is much simpler way: look at the exception property
System.Exception.StackTrace
:
http://msdn.microsoft.com/en-us/library/system.exception.stacktrace(v=vs.110).aspx[
^].
This property is just as string; you cannot do much with it, but you will see all the exception information on the whole stack: all exceptions, file names and line numbers.
Another way is only available starting with C#.v5 and is limited to a single stack frame where you utilize the new "caller information" feature:
http://blogs.msdn.com/b/mvpawardprogram/archive/2012/03/26/introduction-of-new-features-in-c-5-0.aspx[
^].
Look at Section 3, "Caller Information".
—SA