title: Programmatically get C# Stack Trace
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/531695/how-to-print-the-current-stack-trace-in-net-without-any-exception">How to print the current Stack Trace in .NET without any exception?</a> </p>
  </blockquote>
  
  
  
  <p>When an exception is thrown, its text contains the stack trace. Can I somehow obtain the stack trace text(including file and line) without exceptions?</p>
  
  <pre><code>public void f()
  {
     //blah
     string stacktrace = ???;
     //blah
  }
  </code></pre>