将 System.Data.Entity 的组件添加到我的 Web 配置后,出现此错误:在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的部分是错误的。此错误可能是由未在 IIS 中配置为应用程序的虚拟目录引起的。
我删除了 obj 和 bin 文件夹,我删除了行 authentication="windows",尝试重新打开,因为有些人说它有效,我检查了主文件夹中只有 1 个 web.config(实体框架 - 文件夹表格、模型、DAL 和 BLL)...
还有什么其他原因会发生这种情况?我到处搜索,基本上是我发现的上述原因....
这是我的 web.config 如果它有所作为:
<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>
我能做些什么来解决这个问题?