Red Gate forums :: View topic - Error submitting error report using Proxy
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Error submitting error report using Proxy

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
saint168



Joined: 01 Nov 2012
Posts: 10

PostPosted: Tue Apr 08, 2014 5:06 pm    Post subject: Error submitting error report using Proxy Reply with quote

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.
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 230

PostPosted: Wed Apr 09, 2014 11:58 pm    Post subject: Reply with quote

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
Technical Support
Red Gate Software Ltd.
Back to top
View user's profile Send private message
saint168



Joined: 01 Nov 2012
Posts: 10

PostPosted: Thu Apr 10, 2014 12:31 am    Post subject: Reply with quote

I tested both ways and neither worked.
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 230

PostPosted: Fri Apr 11, 2014 9:55 pm    Post subject: Reply with quote

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
Technical Support
Red Gate Software Ltd.
Back to top
View user's profile Send private message
saint168



Joined: 01 Nov 2012
Posts: 10

PostPosted: Mon Apr 14, 2014 9:52 pm    Post subject: Reply with quote

I was skeptical about this fix but it worked! Thank you.
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 230

PostPosted: Mon Apr 14, 2014 10:31 pm    Post subject: Reply with quote

That's great to hear--thanks for letting us know that helped! Smile
_________________
Jessica Ramos
Technical Support
Red Gate Software Ltd.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group