2023年10月17日 星期二

Asp.net 解決根目錄根子目錄應用程式衝突問題

網站越做越大的時候常會有在子目錄底下新增應用程式
這時常會遇到子目錄的web.config跟根目錄的內容有衝突
在根目錄底下新增以下程式碼可直接解決繼承問題
<location path="." inheritInChildApplications="false">
整體如下
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>      
    </system.webServer>
  </location>
</configuration>
參考資料
如何讓同一個 IIS 站台設定兩個不同的 ASP.NET 應用程式