What are the challenges you face when working across database platforms? Take the survey
Options

Error submitting error report using Proxy

saint168saint168 Posts: 12 Bronze 1
edited April 14, 2014 5:31PM in SmartAssembly
I added the following code to the SmartAssemblyUI project:

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.

Comments

  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    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;

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Options
    saint168saint168 Posts: 12 Bronze 1
    I tested both ways and neither worked.
  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    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>

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Options
    saint168saint168 Posts: 12 Bronze 1
    I was skeptical about this fix but it worked! Thank you.
  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    That's great to hear--thanks for letting us know that helped! :)

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.