I suggest you ...

Fix it so that .NET apps can access HTTP thru authenticating proxy server by default

If you run a .NET app that needs to talk to the web, and you're behind an authenticating proxy server, then that app will fail to talk to the web.

Internet Explorer and Google Chrome work, Visual Studio and loads of other Microsoft apps will work. They can all talk to the web. But every .NET-based app or website I've ever seen will fail.

The implications of this are profound. I've seen umpteen forum posts over the years where people are scratching their heads, wondering what's wrong. I've seen IT guys re-route their users thru special-case connections to the web, because the user has to access some web functionality.

I've installed a piece of software that needs to authenticate a license key over the web... only to fail. And then you have to call their support lines.

I've seen Umbraco and Orchard CMS users fail to access the online galleries of themes and widgets. No-one - developers, users, IT guys - have a clue what's wrong or how to fix it.

Even Microsoft's .NET apps fail: if I try to run WCF's svcutil.exe on a remote service, it will fail... because I'm behind an authenticating proxy server.

And yet the fix is so simple. Simple, but no-one knows about it... no-one! Take a look at this StackOverflow question:-

http://stackoverflow.com/questions/299940/how-should-i-set-the-default-proxy-to-use-default-credentials

The simple, simple fix is to add this to your .NET app's app/web config file:-
<system.net>
<defaultProxy useDefaultCredentials="true" />
</system.net>

But since no-one knows about this, let's end the years of confusion and have .NET 4.5 change the default value of useDefaultCredentials from false to true. Problem solved, and everyone can get on with their lives.

If Internet Explorer "just works", why can't .NET-build apps "just work"?

And for a better-argued case, see here:-
http://sticklebackplastic.com/post/2007/01/26/Poxy-proxies.aspx

Thank you.

724 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Andrew WebbAndrew Webb shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    24 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • GaetanoGaetano commented  ·   ·  Flag as inappropriate

        Hey Andres,

        3 days spent on this and about 2000 posts read before to input the right sequence of words in Google and get your page . THANK YOU!!!!!!

        Gaetano

      • daschdaschdaschdasch commented  ·   ·  Flag as inappropriate

        omfg why is this the only page i can read this.
        what´s wrong with this world. 4 days search to find this link :)))

      • James HoodJames Hood commented  ·   ·  Flag as inappropriate

        It would also be nice if defaultProxy would use a manually configured proxy since it currently appears to just work for wpad/pac auto-configured proxies. To echo others in the comments, if the user enters a username/password in IE/Edge for a proxy, it would be nice if that would also work in other places like .NET.

      • DivakarDivakar commented  ·   ·  Flag as inappropriate

        In my case changing the configuration file did not work. However adding ip(in my case) to the exception in IE => Tools => Internet Options => Connections => LAN Settings => Advanced => Exceptions . Sharing because it might help some one.

        Thanks for sharing this Andrew.

      • MoMo commented  ·   ·  Flag as inappropriate

        Andrew,

        Your a top man, you were right, nobody knows about this, your article has been a life saver, our web service calls our now working behind an authenticated proxy. Thank you for sharing...

      • Andrew WebbAndrew Webb commented  ·   ·  Flag as inappropriate

        It's been over three years since I created this suggestion, and still no response at all from Microsoft. Very sad. And obviously we've missed the .NET 4.5 boat.

        However, I'm pleased to see how this suggestion, and my related answer on StackOverflow, has obviously helped a lot of people with this serious, but easily preventable, problem.

      • DmitryDmitry commented  ·   ·  Flag as inappropriate

        Words can't say enough how amazingly brilliant your solution is. No other article on the web does not address the problem so well and precisely! Simply brilliant!

      • Anonymous commented  ·   ·  Flag as inappropriate

        Hi, will this work if its a SQUID proxy with an required authentication set up.

        We have one such proxy and the current settings don't seem to take effect.

      • AnonAnon commented  ·   ·  Flag as inappropriate

        Andrew, you are fantastic. I am definitely one of the people who spent hours scratching their head wondering why the .NET app I support was not able to connect through an authenticating proxy. This was the answer, and it would have saved many troubleshooting hours and much stress if this "just worked" as it does in IE.

      • LarryLarry commented  ·   ·  Flag as inappropriate

        Thanks very much! Came across this after several hours of searching. My 407 error (Proxy Authentication Required) is gone.

      • GilesGiles commented  ·   ·  Flag as inappropriate

        Brilliant Answer. Solved my problem, so easily. gotta love a simple fix. well done.

      • Thomas LevesqueThomas Levesque commented  ·   ·  Flag as inappropriate

        @Pedro, I think it only works if the proxy uses NTLM authentication. I have a Squid proxy with basic authentication, and it doesn't work either.

      • PedroPedro commented  ·   ·  Flag as inappropriate

        It doesn`t work. Although I put in my app.config this sentence:
        <system.net>
        <defaultProxy useDefaultCredentials="true" />
        </system.net>

        Still I'm getting this error in my .Net pgm :
        HTTP status 407: Proxy Authentication Required.

      • Bryan MeloBryan Melo commented  ·   ·  Flag as inappropriate

        I need some help, i'm currently facing the same problem I can go on firefox and surf the web, but i can't use any of the programs that access the internet. This is one of the errors i get when trying to play Dayz. tinypic.com/r/10rsevs/6

      ← Previous 1

      Feedback and Knowledge Base