locked
The remote server returned an error: (500) Internal Server Error. RRS feed

  • Question

  • User1315112726 posted

    I am trying to access a web site using below snippet

    HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);

    HttpWebResponse webResponse = (HttpWebResponse)httpWebRequest.GetResponse();

    This is occuring for particular web site and rest of the web site working fine. 

    Error:

     The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() -532459699... 

    Also, i tried with below options

    1. Adding Credential like

    NetworkCredential networkCredential = new NetworkCredential("user name", "pwd", "domain");

    httpWebRequest.Credentials = networkCredential;

    2. Adding below User Agent. 

    httpWebRequest.UserAgent = "Mozilla/5.0+";

    When i try to access the URL from IE, its working fine. Please help me.

    Wednesday, April 1, 2009 5:33 AM

All replies

  • User-1293249277 posted

    Mostly this error occcurs coz of the proxy settings...did u try setting proxy from ur code? 

    Wednesday, April 1, 2009 5:40 AM
  • User1315112726 posted

    Thanks for your reply.

    How do we set the proxy in the code and any reason for setting proxy since the same url is working in normal IE.

     

    Wednesday, April 1, 2009 5:57 AM
  • User-1159791214 posted

    try

    http://persistall.com/archive/2005/09/17/19.aspx

    Wednesday, April 1, 2009 6:23 AM
  • User1315112726 posted

    I think, proxy is not an issue. I tried, getting unable to resolve remote server error. Any other solution please.

    Wednesday, April 1, 2009 7:59 AM