2018年2月12日 星期一

[ASP.NET] Configuration - location element


 ASP.NET    IIS Express    Location


Introduction


Location element/tag:
Specifies the resource that child configuration settings apply to and locks configuration settings, preventing the settings from being overridden by child configuration files.

<location path="path"  allowOverride="True|False">
</location>




例如在全域的IIS express 站台設定檔:applicationhost.config
<location>裡面的設定將預設覆寫原始設定

<configuration>
    <sites>
        <site name="JB.Sample.MvcSiteMap.Website" id="16">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="XXXXXXX" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:1410:localhost" />
            </bindings>
        </site>
    </sites>
    <location path="JB.Sample.MvcSiteMap.Website">
        <system.webServer>
            <security>
                <authentication>
                    <anonymousAuthentication enabled="false" />
                    <windowsAuthentication enabled="true" />
                </authentication>
            </security>
        </system.webServer>
    </location>
</configuration>

今天花了兩個小時在找開發環境為什麼在WebConfigWindows Authentication關閉後,仍持續收到回傳包含驗證的Responese… 原來兇手就是它。 我的兩個小時 Orz


Reference



沒有留言:

張貼留言