title: System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.IO.StreamWriter'
body: <p>I tried to convert an Object variable into a StreamWriter. But, it does not work. What is the mistake ?</p>
  
  <pre><code>StreamWriter file = (StreamWriter) myObject;
  </code></pre>