相关疑难解决方法(0)

禁用web.config继承?

我在我的网站的根目录中有一个内容管理应用程序,我正在尝试在子文件夹下使用不同的应用程序(计费应用程序).不幸的是,根网站的web.config干扰了子应用程序.

有没有办法只禁用子文件夹的web.config继承?

更新:Stephen Burris链接,使用<location>标记可以阻止部分Web配置的继承,如下所示:

<?xml version="1.0"?>
<configuration>
<configSections>
    ....
</configSections>
<location path="." inheritInChildApplications="false">
    <appSettings>
        ....
    </appSettings>
    <connectionStrings/>
    <system.web>
        ....
    </system.web>
    <system.codedom>
        ....
    </system.codedom>
    <system.webServer>
        ....
    </system.webServer>
</location>
<runtime>
    ....
</runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)

<configSections><runtime>部分将不接受被封装在标签...所以我想这不仅会大部分的工作.谁知道怎么做得更好?

asp.net

35
推荐指数
4
解决办法
3万
查看次数

停止从IIS 7.5中的父ASP.NET应用程序继承web.config

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

如果我尝试在App 1中执行以下操作,web.config:

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

    <!-- etc -->

    </configSections>
</location>
Run Code Online (Sandbox Code Playgroud)

它报告错误:

配置错误配置部分'configSections'无法读取,因为它缺少部分声明

如果我尝试做:

<remove name = "system.web.extensions" /> 
Run Code Online (Sandbox Code Playgroud)

它仍然报告相同的错误:

asp.net configuration web-config

11
推荐指数
2
解决办法
3万
查看次数

标签 统计

asp.net ×2

configuration ×1

web-config ×1