How does an IIS App Pool determine its Internet Settings?

I'm specifying a custom identity under which to host a .NET web application, a service account that is part of our Active Directory domain.

When the application runs, it needs to make HTTP requests to other servers. This action causes it to read web and proxy settings from some location, but I can't understand where it goes for this information.

Does it look:

  • At the default account's settings on that box?
  • At the default profile on the AD server?
  • Its own local/roaming profile?
  • A combination of the above?
  • Somewhere completely different?
  • Are you using .NET methods to get HTTP content? They should be getting proxy settings from IE. Windows maintains global internet options in Control Panel. – user86903 Jul 7 '11 at 11:51
  • A .NET application will normally read the internet settings from the account's local profile. What happens when, as in this case, the account lacks a local profile, because it is just being used as a security principal? – Paul Turner Jul 7 '11 at 14:18

Thought .Net used WinHTTP, eventually, under the covers. (NETSH WINHTTP SH PROXY)

Generally, though, I'd suggest it's best to be explicit about it in the web.config, via the defaultProxy element: http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx

Avoids all that nasty identity-based stuff.

  • And as a sub-answer to your question: The app pool doesn't look anywhere - the application framework you're using will determine the answers to those questions. Using WinInet is different from WinHTTP, which may be different from HttpWebRequest (but as I mentioned, I'm 89% sure it's actually using WinHTTP natively) – TristanK Jul 8 '11 at 0:29
  • Actually, this is where my question comes in: "If the defaultProxy element is empty, the proxy settings from Internet Explorer will be used." – Paul Turner Jul 8 '11 at 8:36
  • It gets complicated if you are (or are not) loading a user profile. For App Pool Identities with a loaded user profile, I assume NetworkService's settings would be the ones. My point is not to let that mess affect you. – TristanK Jul 9 '11 at 3:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.