错误使用注册为allowDefinition ='MachineToApplication“超越应用水平段 [英] Error to use a section registered as allowDefinition='MachineToApplication' beyond application level

查看:105
本文介绍了错误使用注册为allowDefinition ='MachineToApplication“超越应用水平段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是使用注册为allowDefinition ='MachineToApplication超越应用水平的节是错误。

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.

在所有的在我的/门/目录下我的aspx页面最上面一行有此错误信息,我知道这是一个常见的​​一种。我用Google搜索这个错误信息没有尽头,我看到很多帖子告诉我的/门户网站/文件夹配置为在IIS(我有)的应用程序,以及更多帖子告诉我,我有嵌套web.configs(但没有贴子朝提供一个解决方案指南)。

The top line in all of my aspx pages in my /portal/ directory has this error message, and I know it's a common one. I have googled this error message to no end, and I see a lot of posts telling me to configure the /portal/ folder as an application in IIS (which I have), and more posts telling me I have nested web.configs (but none of the postings offer guidance toward a solution).

我的设置是,我在我的根目录下的web.config文件,然后我试图做一个公司门户,在/门/目录。在/门/目录下有自己的(必要的)web.config中。

My setup is that I have a web.config in my root directory, and then I'm trying to make a company portal, in the /portal/directory. The /portal/ directory has its own (necessary) web.config.

我的web.config行50是这样的:

My web.config line 50 is like this:

    <customErrors mode="Off" defaultRedirect="customerrorpage.aspx"/>
    <anonymousIdentification enabled="true"/>
    <authentication mode="Forms"/>
    <membership defaultProvider="MyProvider">

所以我有domain.com/web.config和domain.com/portal/web.config ......所以我domain.com/portal/default.aspx页将不会加载。

So I have domain.com/web.config AND domain.com/portal/web.config ... so my domain.com/portal/default.aspx page will not load.

什么是真正的解决这个?难道我莫名其妙地找到一个方法来合并我的根web.config与我/门/目录下的Web.config,还是我的路要走基地在这里?

What is the real solution to this? Do I somehow find a way to merge my root web.config with my /portal/ directory web.config, or am I way off base here?

任何指导,将大大AP preciated!

Any guidance would be greatly appreciated!

推荐答案

只是背景资料;为ASP.NET网站配置信息是在一个或多个Web.config文件中所定义。配置设置以分层方式施加。有这阐明了在Web服务器上所有网站的基本配置信息的全球性的Web.config文件;该文件住在%WINDIR%\\ Microsoft.Net \\框架\\版本\\ CONFIG 文件夹中。你也可以在你的网站的根文件夹中的Web.config文件。此Web.config文件可能会覆盖在全球Web.config文件中定义的设置,或添加新的。此外,你可能在你的网站的子文件夹,它定义在Web.config中定义的新的配置设置或重写配置设置文件层次结构中的上涨。

Just for background information; Configuration information for an ASP.NET website is defined in one or more Web.config files. The configuration settings are applied in a hierarchical manner. There's a "global" Web.config file that spells out the baseline configuration information for all websites on the web server; this file lives in the %WINDIR%\Microsoft.Net\Framework\version\CONFIG folder. You can also have a Web.config file in the root folder of your website. This Web.config file can override settings defined in the "global" Web.config file, or add new ones. Additionally, you may have Web.config files in the subfolders of your website, which define new configuration settings or override configuration settings defined in Web.config files higher up in the hierarchy.

某些配置元素不能超出应用程序级别定义,这意味着它们必须在全球的Web.config文件或在网站的根文件夹中的Web.config文件中定义。在&LT;身份验证和GT; 元素就是这样一个例子。上述错误信息表明没有在该网站的子文件夹的人比有不能超出该应用程序级别定义这些配置元素之一的Web.config文件中。

Certain configuration elements in Web.config cannot be defined beyond the application level, meaning that they must be defined in the "global" Web.config file or in the Web.config file in the website's root folder. The <authentication> element is one such example. The above error message indicates that there is a Web.config file in one of the website's subfolders than has one of these configuration elements that cannot be defined beyond the application level.

来源:<一个href=\"http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx\">http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx

您已经正确识别了2种可能的方法。

You have correctly identified the 2 possible approaches.

1 - 根据你的第二个web.config文件和内容,如果您的设置允许(即相同的认证方法) - 添加&LT;认证&GT; 设置任何应全局定义顶入web.config中其他元素

1 - Depending on the contents of your second web.config and if your setup would allow (i.e same authentication method) - add the <authentication> settings and any other elements that should be define globally into the top web.config

2 - 如果你不能合并然后Web.config文件的内容,那么你应该能够打开子文件夹复制到IIS中的Web应用程序按照此链接中包含<一个步骤href=\"http://www.tamil$c$cs.com/document.aspx?content=Tutorials&id=42\">http://www.tamil$c$cs.com/document.aspx?content=Tutorials&id=42 (如果无法访问,请参阅archived)
希望这有助于。

2 - If you cannot merge then web.config contents then you should be able to turn the sub-folder into a web application in IIS by following the steps contained in this link http://www.tamilcodes.com/document.aspx?content=Tutorials&id=42 (if inaccessible, see archived) Hope this helps.

这篇关于错误使用注册为allowDefinition ='MachineToApplication“超越应用水平段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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