title: How to document thrown exceptions in c#/.net
body: <p>I am currently writing a small framework that will be used internally by other developers within the company.</p>
  
  <p>I want to provide good Intellisense information, but I am not sure <em>how</em> to document thrown exceptions.</p>
  
  <p>In the following example:</p>
  
  <pre><code>public void MyMethod1()
  {
      MyMethod2();
  
      // also may throw InvalidOperationException
  }
  
  public void MyMethod2()
  {
      System.IO.File.Open(somepath...); // this may throw FileNotFoundException
  
      // also may throw DivideByZeroException
  }
  </code></pre>
  
  <p>I know the markup for documenting exceptions is:</p>
  
  <pre><code>/// &lt;exception cref="SomeException"&gt;when things go wrong.&lt;/exception&gt;
  </code></pre>
  
  <p>What I don't understand is how to document exceptions thrown by code <strong>called by</strong> <code>MyMethod1()</code>?</p>
  
  <ul>
  <li>Should I document exceptions thrown by <code>MyMethod2()</code></li>
  <li>Should I document exceptions thrown by <code>File.Open()</code> ?</li>
  </ul>
  
  <p>What would be the best way to document possible exceptions?</p>