C# MVC3/MVC4中的简单成员身份和角色提供程序
我正在编写简单的成员资格和角色提供程序。 我正在尝试从post运行代码,但在运行IIS时显示错误:C# MVC3/MVC4中的简单成员身份和角色提供程序,c#,asp.net-mvc-3,asp.net-mvc-4,membership-provider,roleprovider,C#,Asp.net Mvc 3,Asp.net Mvc 4,Membership Provider,Roleprovider,我正在编写简单的成员资格和角色提供程序。 我正在尝试从post运行代码,但在运行IIS时显示错误: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your config
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Line 39: <providers>
Line 40: <clear />
Line 41: <add name="LocalBankMembershipProvider" type="LocalBank.Helpers.LocalBankMembershipProvider, LocalBank" connectionStringName="LocalBankEntities" />
Line 42: </providers>
Line 43: </membership>
Message Parser Error: Target call threw an exception.
Line: 41
配置错误
描述:处理服务此请求所需的配置文件时出错。请查看下面的特定错误详细信息,并适当修改配置文件。
第39行:
第40行:
第41行:
第42行:
第43行:
消息分析器错误:目标调用引发异常。
第41行
我在项目开始时犯了什么错误?
使用Nuget包将项目从mvc3转换为mvc4
如何修复此错误?您是否遵循了同一链接评论部分中给出的建议 有几件事可以尝试:
LocalBankRepository repo = new LocalBankRepository();
repo.AddRole("Member");
repo.Save();