title: 'System.Net.FileWebRequest' can not be casted to 'System.Net.HttpWebRequest' on remote machine, but works locally
body: <p>I am getting the error when trying from a server (deployed the same code on the server):</p>
  <blockquote>
  <p><code>Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.HttpWebRequest'</code></p>
  </blockquote>
  <p>But when I am trying to use the same code from my local machine, it is not giving error.</p>
  <pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
  </code></pre>
  <p>Any idea guys what could be wrong?</p>