title: how to determine which parameter at fault when "Value does not fall within the expected range"
body: <p>When searching here on stackoverflow, it's apparent that System.ArgumentException "Value does not fall within the expected range" occurs in many different API calls for many different reasons. I'm seeking general advice for determining WHICH specific parameter, in an API call that has a lot of parameters, is the root cause. Perhaps the exception itself contains that info somewhere, or a debugger feature that will clarify it? The particular example I've encountered is in VS2017 "Community", at this call:</p>
  
  <pre><code>var bmp = BitmapSource.Create(img.PixelWidth, img.PixelHeight, DPI, DPI, PixelFormats.Rgb24, img.Palette, destPixelData, img.PixelWidth/24);
  </code></pre>