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>