1. 程式人生 > >IIS如何讓子web應用程序中繼承根目錄web.config

IIS如何讓子web應用程序中繼承根目錄web.config

根目錄 lec DApp color nbsp 如何 應用程序 pan onf

1、一種方式,需要改動根目錄的web.config(不是很推薦)

<?xml version="1.0"?>
<configuration>
 <location path="." inheritInChildApplications="false"> 
 <!-- Stuff that shouldn‘t be inherited goes in here -->
 </location>
</configuration>

2、直接創建一個新的應用程序並編輯 applicationHost.config 文件( 位於 C:\Windows\System32\inetsrv\config下).  

找到對應的應用池相關內容加上enableConfigurationOverride="false"屬性即可避免繼承。

<add name="應用池名稱" autoStart="true"  enableConfigurationOverride="false">

</add>

  

IIS如何讓子web應用程序中繼承根目錄web.config