views:

351

answers:

2

What is the meaning of:

<location path="web.config">

With the following web.config file (located in the root of the web app) will doDynamicCompression be set to true or false?

<configuration>
    <system.webServer>
        <urlCompression doDynamicCompression="true" />
    </system.webServer>

    ...

    <location path="web.config">
        <system.webServer>
            <urlCompression doDynamicCompression="false" />
        </system.webServer>
    </location>
</configuration>
+1  A: 

This:

<location path="web.config">

Represents special settings for that path or file, overriding settings for the root and below, which is what all your settings without a location tag do. web.config is never served anyway...so dynamic compression will be enabled in your example.

Nick Craver
A: 

Location tag is used to apply settings to a given file or path from a web.config file. Alternatively you can put a web.config file in a directory and put your settings there. Both ways you'll override the settings from the web.config in your root directory or the machine.config. ASP.NET is configured not to server .config files so in your case this configuration is unusable.

Branislav Abadjimarinov