Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I have an IIS setting configured both in ApplicationHost.config and web.config, what value is going to be applied? Is it an ApplicationHost.config value because it is global to all websites or web.config value because it overrides it? And what happens when I haven't configured it in web.config, should it take this setting from ApplicationHost.config?

The particular setting I have to check is: system.webServer/security/requestFiltering/requestLimits/maxAllowedContentLength

The reason I'm asking is because I'm getting quite strange results when I try to configure those settings from the C# application. Even if I haven't configured it for the website and I have manually set the value in the ApplicationHost.config I'm still getting a default value from web.config

share|improve this question
    
Have a look at my answer to this question, about half way down I have an explanation of how feature delegation affects where things are stored: serverfault.com/a/337078/822 –  Kev Dec 4 '11 at 1:33
add comment

1 Answer

up vote 1 down vote accepted

Config files inherit their values as you move down in scope (server -> site -> application), but by default it's only for specific sections. The IIS site has an article on the ApplicationHost.config file as well as configuration delegation.

As an example, there are two different requestFiltering sections within applicationHost.config: one for an FTP server and one for web sites. You can see how the section for web sites (system.webServer) allows the values to be overridden:

<section name="requestFiltering" overrideModeDefault="Allow" />

Whereas the section under system.ftpServer does not.

<section name="requestFiltering" overrideModeDefault="Deny" />

So, onto your question. You should be able to update the Web.config to modify the allowed content length for your site (and sub-sites), unless you have changed the overrideModeDefault value in your applicationHost.config.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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