title: XML-Documentation of multiple exceptions for C#
body: <p>I'm actually searching for a guidline, how to document multiple exceptions in a public method inside a C#-DLL.</p>
  
  <p>example:</p>
  
  <pre class="lang-xml prettyprint-override"><code>/// &lt;summary&gt;
  /// This method does something
  /// &lt;/summary&gt;
  /// &lt;param name="p_Parameter1"&gt;First parameter&lt;/param&gt;
  /// &lt;param name="p_Parameter2"&gt;Second parameter&lt;/param&gt;
  /// &lt;param name="p_Number"&gt;A number&lt;/param&gt;
  /// &lt;exception cref="ArgumentNullException"&gt;
  /// Thrown if p_Parameter1 is null&lt;/exception&gt;
  /// &lt;exception cref="ArgumentNullException"&gt;
  /// Thrown if p_Parameter2 is null&lt;/exception&gt;
  /// &lt;exception cref="ArgumentNullException"&gt;
  /// Thrown if any element of p_Parameter2 is null&lt;/exception&gt;
  /// &lt;exception cref="ArgumentOutOfRangeException"&gt;
  /// Thrown if p_Number is below or equal 0&lt;/exception&gt;
  /// &lt;returns&gt;A object&lt;/returns&gt;
  </code></pre>
  
  <pre class="lang-cs prettyprint-override"><code>public static object DoSomething(
      object p_Parameter1, IList&lt;object&gt; p_Parameter2, 
      object p_Parameter3, int p_Number)
  {
      if(p_Parameter1 == null)
          throw new ArgumentNullException(
              paramName:"p_Parameter1", 
              message:"Parameter is needed");
      if (p_Parameter2 == null)
          throw new ArgumentNullException(
              paramName: "p_Parameter2", 
              message: "Parameter is needed");
  
      for (int i = 0; i &lt; p_Parameter2.Count; i++)
      {
          if(p_Parameter2[i] == null)
              throw new ArgumentNullException(
                  paramName: String.Format("p_Parameter2[{0}]", i),
                  message: "All elements have to be initialized");
      }
  
      if(p_Number &lt; 0)
          throw new ArgumentOutOfRangeException(
              paramName: "p_Number", 
              message: "Parameter should be bigger then zero");
  
      var returnValue = new object();
  
      // do something where p_Parameter3 == null is allowed
  
      return returnValue;
  }
  </code></pre>
  
  <p>Is it the right way to document those exceptions? Should I add one exception-tag for each case, or should I add only one for all Parameters for which null-values ar not allowed?</p>
  
  <pre class="lang-xml prettyprint-override"><code>/// &lt;exception cref="ArgumentNullException"&gt;
  /// Thrown if p_Parameter1, p_Parameter2
  /// or any element of p_Parameter2 are null&lt;/exception&gt;
  </code></pre>