|
-
February 11th, 2010, 04:42 AM
#1
Webclient: The remote server returned an error: (407) Proxy Authentication Required.
Hi all,
I have the following existing code (already in production for a few months)
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"));
...
}
Since yesterday, I recieve the following exception on client.OpenRead: Webclient: The remote server returned an error: (407) Proxy Authentication Required.
Now I changed the code to
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")
};
}
Now it is working again, but this would mean that everyone here needs to reinstall the application (it's a winform app).
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?
-
February 11th, 2010, 09:59 AM
#2
Re: Webclient: The remote server returned an error: (407) Proxy Authentication Requir
Really strange, the exception disappeared... The network administrator here is not aware of any changes made that possibily could have caused this error.
Anyone here an idea?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|