title: How to override timeout value on System.IO.Stream .OpenRead(): Getting ReadTimeout threw an exception of type 'System.InvalidOperationException'
body: <p>I am trying to convert an Azure Cloud File into a stream:</p>
  
  <pre><code>System.IO.Stream stream = cloudFile.OpenRead();
  </code></pre>
  
  <p>That line throws this error:</p>
  
  <blockquote>
    <p>ReadTimeout = 'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException'</p>
  </blockquote>
  
  <p>If I am reading this documentation properly ([Stream.ReadTimeout Property][1]), it looks like I should be able to override the default time out value, but I am not seeing how to do that. I've been looking at lots of other threads here about this:</p>
  
  <p><a href="https://stackoverflow.com/questions/44693705/c-sharp-stream-readtimeout-property">C# Stream.ReadTimeout Property</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17215966/c-sharp-stream-read-with-timeout">C# Stream.Read with timeout</a></p>
  
  <p><a href="https://stackoverflow.com/questions/37006582/stream-read-write-timeout-causes-invalid-operation-exception">Stream Read/Write Timeout causes Invalid Operation Exception</a></p>
  
  <p>... to name just a few. But so far I've not found a solution in any of them. </p>
  
  <p>NOTE: Some of the threads I've read said this error will only happen in VS while debugging. But, we get the exact same error on the exact same line when this Azure Function app is published to Azure and executed in production.</p>
  
  <p>My question is: How do I set the timeout value on <code>OpenRead()</code> to something longer than the default?  (Or... am I looking at this wrong?)</p>