我试图使用位置属性来设置sarthitInChildApplications = false这样我就可以在没有配置冲突的情况下将第二个应用程序嵌套在现有的IIS应用程序下。
但是有一个问题。第二个应用程序www.mydomain.com/secondapp/home将加载,但是现在,父母应用程序中的所有页面都不会加载,即www.mydomain.com/aboutus抛出了异常,因为Httphandlers未加载。
如何使httphandlers在父站点的子页面上加载,但不能在第二个应用程序中加载?
我一直在使用以下位置:
<location path="." inheritInChildApplications="false">
<system.web>
<!-- Stuff -->
<httpHandlers>
Blah
</httpHandlers>
</system.web>
</location>
<location path="." inheritInChildApplications="false">
<system.webServer>
<!-- Stuff -->
<handlers>
Blah
</handlers>
</system.webServer>
</location>
我最终修复解决方案的方式是从儿童配置中删除违规处理程序,模块,扩展程序和组件,而不是使用位置。即:
<httpHandlers>
<remove name="offendingHttphandler" />
Rest of the good handlers
</httpHandlers>
P.S。只需祈祷嵌套应用程序没有使用不同管道或.NET版本的其他应用程序池。但愿。否则该解决方案将不起作用。