我正在尝试在ASP.NET MVC中使用devart SimpleMembership和SimpleRole Providers for Oracle我在Tutorial中进行了操作,但在步骤7 中,当我在我的应用程序中午餐时,我收到此错误:
Erreur HTTP 500.19 - Internal Server Error
Unable to access the page you requested because the related configuration data for the page is invalid.
Error description : Unable to read configuration section 'membership' because a declaration section is missing
在这一行(他用红色着色):
<membership defaultProvider="MySqlExtendedMembershipProvider">
这是我的web.config文件的一部分:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<membership defaultProvider="MySqlExtendedMembershipProvider">
<providers>
<remove name="OracleExtendedMembershipProvider"/>
<add name="OracleExtendedMembershipProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedMembershipProvider,
Devart.Data.Oracle.Web, Version=8.3.135.4, Culture=neutral, PublicKeyToken=09af7300eec23701"
description="dotConnect for Oracle extended membership provider" connectionStringName="DefaultConnection" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="OracleExtendedRoleProvider">
<providers>
<remove name="OracleExtendedRoleProvider"/>
<add name="OracleExtendedRoleProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedRoleProvider,
Devart.Data.Oracle.Web, Version=8.3.135.4, Culture=neutral, PublicKeyToken=09af7300eec23701"
description="dotConnect for Oracle extended role provider" connectionStringName="DefaultConnection" />
</providers>
</roleManager>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="User Id=devart;Password=1234;Data Source=localhost:1521" providerName="Devart.Data.Oracle" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
那么这里有什么问题?
答案 0 :(得分:0)
要解决问题,请更换:
<membership defaultProvider="MySqlExtendedMembershipProvider">
使用:
<membership defaultProvider="OracleExtendedMembershipProvider">
我们的教程中有一个印刷错误,我们会修复它。 我们的文档http://www.devart.com/dotconnect/oracle/docs/?ExtendedMembership-Tutorial.html
中提供了相同的信息,但没有印刷错误答案 1 :(得分:0)
为了解决这个问题,我不得不移动membership element
(和孩子)以及roleManager element
元素内的system.web
。像这样:
<system.web>
<membership ... > </membership>
<roleManager ...> </roleManger>
...
</system.web>