title: .NET: How to convert Exception to string?
body: <p>When an exception is thrown (while debugging in the IDE), i have the opportunity to <em>view details</em> of the exception:</p>
  
  <p><img src="https://i.stack.imgur.com/NNcx3.png" alt="enter image description here"></p>
  
  <p>But in code if i call <code>exception.ToString()</code> i do not get to see those useful details:</p>
  
  <pre><code>System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'FetchActiveUsers'.
    [...snip stack trace...]
  </code></pre>
  
  <p>But Visual Studio has some magic where it can <em>copy the exception to the clipboard</em>:</p>
  
  <p><img src="https://i.stack.imgur.com/kSOUl.png" alt="enter image description here"></p>
  
  <p>Which gives the useful details:</p>
  
  <pre><code>System.Data.SqlClient.SqlException was unhandled by user code
    Message=Could not find stored procedure 'FetchActiveUsers'.
    Source=.Net SqlClient Data Provider
    ErrorCode=-2146232060
    Class=16
    LineNumber=1
    Number=2812
    Procedure=""
    Server=vader
    State=62
    StackTrace:
         [...snip stack trace...]
    InnerException:
  </code></pre>
  
  <p>Well i want that!</p>
  
  <p>What would be the contents of:</p>
  
  <pre><code>String ExceptionToString(Exception ex)
  { 
      //todo: Write useful routine
      return ex.ToString();
  }
  </code></pre>
  
  <p>that can accomplish the same magic. Is there a .NET function built in somewhere? Does <code>Exception</code> have a secret method somewhere to convert it to a string?</p>