注册为allowDefinition ='MachineToApplication“超越应用水平段 [英] a section registered as allowDefinition='MachineToApplication' beyond application level
问题描述
添加System.Data.Entity的的assebly到我的web配置后,我得到这个错误:
它是使用注册为allowDefinition =应用程序级别之外'MachineToApplication'的节是错误的。这个错误可以通过未被配置为在IIS中应用程序的虚拟目录引起的。
After adding the assebly of System.Data.Entity to my web config I got this error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
我删除了OBJ和bin文件夹,我删除了行认证=窗口,试图为一些已表示它的工作,我已签有只有1 web.config中的主文件夹中(实体框架重新开放 - 文件夹用于表单,模型,DAL和BLL)...
I have deleted the obj and bin folders, I removed the line authentication="windows", tried to reopen as some has said it worked, I have checked that there is only 1 web.config within the main folder (Entity Framework - Folder for forms, model, DAL and BLL)...
什么其他的原因是那里,会出现这种情况?我搜索无处不在,它基本上是我发现上面的原因....
What other reasons is there that this will happen? I searched everywhere and it's basically the above reasons I found....
这是我的web.config如果它使一个区别:
This is my web.config if it makes a difference:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="CStringVKB" connectionString="Data Source=.;Initial Catalog=VKB;Persist Security Info=True;User ID=websiteservice;Password=websiteservice" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" optimizeCompilations="true" targetFramework="4.0" >
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<!--<authentication mode="Windows">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>-->
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
我能做些什么来解决这个问题?
What can I do to solve this?
推荐答案
基本上,错误意味着在你的子文件夹中有,它不应该有一个配置元素之一的web.config文件。这是你的根/只的网络配置文件?如果没有,你能不能请张贴那些呢?
Basically, the error means that there is a web.config file in one of your subfolders that has a configuration element that it should not have. Is this you root/only web config file? If not, could you please post those as well?
此外,它听起来很愚蠢,但我会仔细检查你打开网站本身在你的IDE(而不是错误地打开父文件夹),我看到有人花了几个小时,试图调试此相同的错误,当一直以来他们不是在正确的目录。
Also, it sounds stupid, but I would double check that you're opening the website itself in your IDE (and not mistakenly opening a parent folder) I have seen people spend a couple hours trying to debug this same error, when all along they weren't in the right directory.
下面是在web.config中层次结构是如何设立ASP一个很好的解释,这将帮助您直观如何工作的:<一href=\"http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx\">http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx
Here is a good explanation on how the web.config hierarchy is set up for ASP that will help you visualize how this works: http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx
这篇关于注册为allowDefinition ='MachineToApplication“超越应用水平段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!