停止在IIS 7.5中从父ASP.NET应用程序继承web.config [英] Stop inheriting web.config from parent ASP.NET application in IIS 7.5

查看:290
本文介绍了停止在IIS 7.5中从父ASP.NET应用程序继承web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在IIS 7.5中部署了一个ASP.NET网站(应用程序1)。然后在该应用程序下创建另一个ASP.NET应用程序(应用程序2)。但在App 2中,我不想继承应用程序1中的 web.config

We have deployed an ASP.NET Website (App 1) in IIS 7.5. Then under that application create another ASP.NET application (App 2). But in App 2, I don't want to inherit the web.config from App 1.

尝试在应用程序1的 web.config 中执行以下操作:

If I try to do the following in App 1's, web.config:

<location path="." inheritInChildApplications="false"> 
    <configSections> 

    <!-- etc -->

    </configSections>
</location>

它报告错误:


配置错误配置部分configSections不能
读取,因为它缺少一个部分
声明

Config Error The configuration section 'configSections' cannot be read because it is missing a section declaration

如果我尝试执行:

<remove name = "system.web.extensions" /> 

它仍然报告同样的错误:

it still reports the same error:

推荐答案

如果您可以将子应用程序部署到单独的网站(同一台计算机,不同的端口),请应用程序请求路由可能能够帮助解决此问题。

If you can deploy your child application to a separate website (same machine, different port), Application Request Routing may be able to help with this.

解决方案类似于此帖。首先,安装 ARR 。然后,在侦听非标准端口的网站上配置您的子应用程序。接下来,在父应用程序的网站上配置与子应用程序的原始路径匹配的重写规则。有这个规则将请求转发给新创建的网站监听新端口。

The solution is similar to this post. First, install ARR. Then, configure your "child" application on a website that listens on a non-standard port. Next, configure a rewrite rule on the "parent" application's web site that matches the original path to the "child" application. Have this rule forward the request to the newly created website listening on the new port.

我会发布一个示例,但我期望这是相当直接,通过查看上面引用的帖子

I would post an example, but I expect it is fairly straightforward to see how this would work by looking at the post referenced above.

这篇关于停止在IIS 7.5中从父ASP.NET应用程序继承web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆