开发者

What is <location path="web.config"> for?

开发者 https://www.devze.com 2022-12-19 17:36 出处:网络
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?

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?

<conf开发者_运维技巧iguration>
    <system.webServer>
        <urlCompression doDynamicCompression="true" />
    </system.webServer>

    ...

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号