Comments
5 comments
-
Hi there!
Please bear with me as I'm not experienced in coding with proxies..
Can I check-- is this error while testing on your own machine? Could you do a test to see if manually setting the credentials to the default credentials instead of enabling UseDefaultCredentials makes any difference?
proxy.Credentials = System.Net.CredentialCache.DefaultCredentials; -
I tested both ways and neither worked.
-
Hm okay, thanks for trying that.
I know it should essentially do the same thing as what you're doing in the code, but could you kindly try editing your app.exe.config file, or adding one for your application, that sets the useDefaultCredentials property to see if that gets things working?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<defaultProxy useDefaultCredentials="true" />
</system.net>
</configuration> -
I was skeptical about this fix but it worked! Thank you.
-
That's great to hear--thanks for letting us know that helped!
Add comment
Please sign in to leave a comment.
if (ProxyAddress != "")
{
var proxy = new WebProxy(ProxyAddress);
proxy.UseDefaultCredentials = true;
this.unhandledExceptionHandler.SetProxy(proxy);
}
try
{
SendReport();
SendEmail();
}
catch
{
AddToEventLog(body.ToString());
}
However, I got: "ERR 2001L The request failed with HTTP status 407: Proxy Authentication Required..... " submitting the error report. The proxy server was working correctly on that machine when using IE.