防止继承父web。配置到IIS 7.5上的子应用程序

时间:2021-08-23 01:29:31

On IIS 7.5 I have parent site using parentAppPool and SubApplication using childAppPool.

在IIS 7.5中,我有使用parentAppPool的父站点和使用childAppPool的子应用程序站点。

Parent site load all fine, but when I access subApplication as http://parentSite.com/SubApplication it is expecting DLLs from Parent site bin

父站点加载一切正常,但是当我作为http://parentSite.com/SubApplication访问子应用程序时,它期望从父站点bin获取dll

In order to prevent the web.config inheritance, I tried wrapping <system.web> with <location path="SubApplication" inheritInChildApplications="false"> and <location path="." inheritInChildApplications="false"> this is breaking the parent site to work.

为了防止网络。配置继承,我尝试包装 具有 这破坏了父站点的工作。 。web>

Then I tried adding enableConfigurationOverride="false" attribute to SubApplicationPool in applicationHost.config that also didn't work

然后我尝试在applicationHost中向SubApplicationPool添加enableConfigurationOverride=“false”属性。配置也不起作用

Any help would be appreciated.

如有任何帮助,我们将不胜感激。

high level skeleton of web.config 防止继承父web。配置到IIS 7.5上的子应用程序

配置的高级框架

When I try this, I get Telerik error on parent site, but child site works!

当我尝试这个时,我在父站点上得到Telerik错误,但是子站点可以工作!

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

~ / Telerik.Web.UI.WebResource。配置中缺少axd'。RadScriptManager需要在web.config中进行HttpHandler注册。请使用控件智能标记自动添加处理程序,或者参见帮助获得更多信息:控件> RadScriptManager

2 个解决方案

#1


1  

If there is a specific configuration that you would like to be removed from the inheritance chain, you can use the <clear/> tag to remove any previous reference setting in the parent and you can start fresh.

如果您希望从继承链中删除特定的配置,您可以使用 标记来删除父节点上的任何以前的引用设置,您可以重新开始。

The following example taken from here show how to remove previous memebership details and create a new one

下面的示例展示了如何删除先前的memebership细节并创建一个新细节。

 <membership>
   <providers>
      <clear/>
      <add name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider, 
                System.Web, Version=2.0.0.0, 
                Culture=neutral, 
                PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="MyDatabase"
          enablePasswordRetrieval="false"
          (additional elements removed for brevity)
       />
   </providers>
 </membership> 

#2


0  

Using the <location> element I was able to disable the inheritance.

使用 元素我可以禁用继承。

防止继承父web。配置到IIS 7.5上的子应用程序 But that raised new error with Telerik controls

但这又带来了Telerik控件的新错误

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

~ / Telerik.Web.UI.WebResource。配置中缺少axd'。RadScriptManager需要在web.config中进行HttpHandler注册。请使用控件智能标记自动添加处理程序,或者参见帮助获得更多信息:控件> RadScriptManager

In order to solve that, I used EnableHandlerDetection attribute as mentioned in this Telerik.Web.UI.RadScriptManager Documentation

为了解决这个问题,我使用了在Telerik.Web.UI中提到的EnableHandlerDetection属性。RadScriptManager文档

EnableHandlerDetection Boolean

EnableHandlerDetection布尔

Gets or sets a value indicating if RadScriptManager should check the Telerik.Web.UI.WebResource handler existence in the application configuration file.

获取或设置一个值,该值指示RadScriptManager是否应该检查Telerik.Web.UI。在应用程序配置文件中存在WebResource处理程序。

Remarks

讲话

When EnableHandlerDetection set to true, RadScriptManager automatically checks if the HttpHandler it uses is registered to the application configuration file and throws an exception if the HttpHandler registration missing. Set this property to false if your scenario uses a file to output the combined scripts, or when running in Medium trust.

当EnableHandlerDetection设置为true时,RadScriptManager会自动检查它使用的HttpHandler是否注册到应用程序配置文件中,如果HttpHandler注册丢失,则会抛出异常。如果您的场景使用一个文件输出组合的脚本,或者在Medium trust中运行时,请将此属性设置为false。

Then I ended up with another error

然后我又犯了一个错误。

HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

内部服务器出错。已检测到不适用于集成管理管道模式的NET设置。

To resolve that I made the following changes to <system.webserver>

为了解决这个问题,我对 做了以下更改

 <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

  <location path="." inheritInChildApplications="false">
  <system.webServer>
    <!--<validation validateIntegratedModeConfiguration="false" />-->
    <modules runAllManagedModulesForAllRequests="true">
    .... other stuff
   </system.webServer>
  </location>

#1


1  

If there is a specific configuration that you would like to be removed from the inheritance chain, you can use the <clear/> tag to remove any previous reference setting in the parent and you can start fresh.

如果您希望从继承链中删除特定的配置,您可以使用 标记来删除父节点上的任何以前的引用设置,您可以重新开始。

The following example taken from here show how to remove previous memebership details and create a new one

下面的示例展示了如何删除先前的memebership细节并创建一个新细节。

 <membership>
   <providers>
      <clear/>
      <add name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider, 
                System.Web, Version=2.0.0.0, 
                Culture=neutral, 
                PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="MyDatabase"
          enablePasswordRetrieval="false"
          (additional elements removed for brevity)
       />
   </providers>
 </membership> 

#2


0  

Using the <location> element I was able to disable the inheritance.

使用 元素我可以禁用继承。

防止继承父web。配置到IIS 7.5上的子应用程序 But that raised new error with Telerik controls

但这又带来了Telerik控件的新错误

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

~ / Telerik.Web.UI.WebResource。配置中缺少axd'。RadScriptManager需要在web.config中进行HttpHandler注册。请使用控件智能标记自动添加处理程序,或者参见帮助获得更多信息:控件> RadScriptManager

In order to solve that, I used EnableHandlerDetection attribute as mentioned in this Telerik.Web.UI.RadScriptManager Documentation

为了解决这个问题,我使用了在Telerik.Web.UI中提到的EnableHandlerDetection属性。RadScriptManager文档

EnableHandlerDetection Boolean

EnableHandlerDetection布尔

Gets or sets a value indicating if RadScriptManager should check the Telerik.Web.UI.WebResource handler existence in the application configuration file.

获取或设置一个值,该值指示RadScriptManager是否应该检查Telerik.Web.UI。在应用程序配置文件中存在WebResource处理程序。

Remarks

讲话

When EnableHandlerDetection set to true, RadScriptManager automatically checks if the HttpHandler it uses is registered to the application configuration file and throws an exception if the HttpHandler registration missing. Set this property to false if your scenario uses a file to output the combined scripts, or when running in Medium trust.

当EnableHandlerDetection设置为true时,RadScriptManager会自动检查它使用的HttpHandler是否注册到应用程序配置文件中,如果HttpHandler注册丢失,则会抛出异常。如果您的场景使用一个文件输出组合的脚本,或者在Medium trust中运行时,请将此属性设置为false。

Then I ended up with another error

然后我又犯了一个错误。

HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

内部服务器出错。已检测到不适用于集成管理管道模式的NET设置。

To resolve that I made the following changes to <system.webserver>

为了解决这个问题,我对 做了以下更改

 <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

  <location path="." inheritInChildApplications="false">
  <system.webServer>
    <!--<validation validateIntegratedModeConfiguration="false" />-->
    <modules runAllManagedModulesForAllRequests="true">
    .... other stuff
   </system.webServer>
  </location>