title: Print stack trace information from C#
body: <p>As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screenshot of the error message dialog instead of sending us a copy of the full report available from the program, and thus I'd like to make some minimal stack trace information available in this dialog.</p>
  
  <p>A .NET stack trace on my machine looks like this:</p>
  
  <pre><code>at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
  at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
  at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
  at System.IO.StreamReader..ctor(String path)
  at LVKWinFormsSandbox.MainForm.button1_Click(Object sender, EventArgs e) in C:\Dev\VS.NET\Gatsoft\LVKWinFormsSandbox\MainForm.cs:line 36
  </code></pre>
  
  <p>I have this question:</p>
  
  <p>The format looks to be this:</p>
  
  <pre><code>at &lt;class/method&gt; [in file:line ##]
  </code></pre>
  
  <p>However, the <em>at</em> and <em>in</em> keywords, I assume these will be localized if they run, say, a norwegian .NET runtime instead of the english one I have installed.</p>
  
  <p>Is there any way for me to pick apart this stack trace in a language-neutral manner, so that I can display only the file and line number for those entries that have this?</p>
  
  <p>In other words, I'd like this information from the above text:</p>
  
  <pre><code>C:\Dev\VS.NET\Gatsoft\LVKWinFormsSandbox\MainForm.cs:line 36
  </code></pre>
  
  <p>Any advice you can give will be helpful.</p>