Hi all,
I have the following existing code (already in production for a few months)
Since yesterday, I recieve the following exception on client.OpenRead: Webclient: The remote server returned an error: (407) Proxy Authentication Required.Code:using (System.Net.WebClient client = new System.Net.WebClient()) { client.Credentials = new System.Net.NetworkCredential("user", "pass", "domain"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(client.OpenRead("http://url.com/doc.xml")); ... }
Now I changed the code to
Now it is working again, but this would mean that everyone here needs to reinstall the application (it's a winform app).Code:using (System.Net.WebClient client = new System.Net.WebClient()) { client.Credentials = new System.Net.NetworkCredential("user", "pass", "domain"); client.Proxy = new System.Net.WebProxy() { Credentials = new System.Net.NetworkCredential("user", "pass", "domain") }; }
The folder where the XML file is located, is secured with Windows Authentication. Even if I enable Anonymous Authentication in IIS, I get the same exception.
Is there any way to prevent this error from happening without the code change, so that the users do not need to reinstall the app?




Reply With Quote