Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4550154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:27:30+00:00 2026-05-21T16:27:30+00:00

In my ASP.NET application I am using the WebRequest class and I want to

  • 0

In my ASP.NET application I am using the WebRequest class and I want to use the default system proxy. Here is the code I am using.

private static bool CheckIfUriIsReachable(string uri)
{
    bool reachable = true;

    var request = (HttpWebRequest)WebRequest.Create(uri);
    request.Method = "HEAD";

    var proxy = WebRequest.GetSystemWebProxy();

    proxy.Credentials = CredentialCache.DefaultCredentials;
    request.Proxy = proxy;

    HttpWebResponse response = null;
    try
    {
        response = (HttpWebResponse)request.GetResponse();
    }
    catch (WebException)
    {
        reachable = false;
    }
    finally
    {
        if (response != null)
        {
            response.Close();
        }
    }

    return reachable ;
}

This works perfectly well when run as part of a console application – it correctly picks up the system proxy (I assume the IE proxy for the signed-on user on the PC), However, this does not work when run as part of an ASP.NET application on the same machine. No proxy is found.

I assume this is because ASP.NET is running under a user account that does not have an IE proxy setting in the system registry. I have tried to include the following in the web.config file but this does not work.

<system.net>
   <defaultProxy>
       <proxy usesystemdefault="true" />
   </defaultProxy>
</system.net>

My question is how to setup an ASP.NET 3.5 application to correctly use the default proxy used by IE?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:27:31+00:00Added an answer on May 21, 2026 at 4:27 pm

    There is not system-wide default proxy. Thus you can only use th configuration of the current user. If there is no such configuration, you have a problem.

    You can try to run the app pool of your ASP.NET application under a user with a proxy configuration or look into group policies, which, AFAIK, do support setting a system-wide proxy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Friends, I'm populating a GridView in my asp.net application using following code. GridView grdExport
I'm in a ASP.NET application using Windows Authentication. I'm using HttpContext.Current.User.Identity.Name to get the
I have an ASP.NET application using the Telerik Q1 2009 controls. I have a
Example scenario in an ASP.NET application using SQL Server membership provider : 1) a
So basically I am thinking about attempting load testing on my asp.net application using
I'm running into a case where an ASP.NET application using the built-in globalization facilities
I'm having a really frustrating error trying to secure an ASP.NET application using the
I have an ASP.NET MVC application using Authorization Attributes on Controllers and Actions. This
I have a ASP.NET MVC application using NHibernate and the application runs fine when
I maintain a legacy ASP.Net Web application (using .Net 2.0 + SQL Server 2005

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.