title: How do I solve this error in Stream.ReadTimeOut error?
body: <p>I am getting an exception in the following code:</p>
  
  <pre><code>(System.IO.MemoryStream) Stream stream = new MemoryStream(fcr.FileContents);
  System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
  </code></pre>
  
  <p>I wrapped it in a Try/Catch &amp; the exception is thrown on the second line: Message = "Parameter is not valid."</p>
  
  <p>I checked the contents of the variable <code>stream</code>. This is where the error is. Expanding the contents of <code>stream</code>, I find:</p>
  
  <pre><code>Read.TimeOut: 'stream.Read.TimeOut'threw an exception of type 
  'System.InvalidOperationException'
  Write.TimeOut: 'stream.Write.TimeOut' thew an exception of type 
  'System.InvalidOperationException'
  </code></pre>
  
  <p>I have 2 questions:</p>
  
  <ol>
  <li>Why wasn't the first error picked up in the Try/Catch?</li>
  <li><p>How do I solve it?</p>
  
  <pre><code>using (Stream stream = new MemoryStream(fcr.FileContents))
          {
          System.Drawing.Image img = System.Drawing.Image.FromStream(stream, true, true);
  </code></pre></li>
  </ol>
  
  <p>Continues to crash in here with Parameter is not valid. 
  The object stream still has read &amp; write TimeOut messages.</p>