IIS如何避免子web應用程序中繼承根目錄web.config配置


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>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM