asp.net-mvc-4 – 如果使用实体连接字符串(与SQL连接字符串一起使用),ASP.NET MVC4简单成员身
发布时间:2020-05-24 15:35:06 所属栏目:asp.Net 来源:互联网
导读:我正在使用Entity Framework 5开发ASP.NET MVC4应用程序,我正在使用Model First模式. 但是,如果我使用设计器生成的连接字符串,则Simple Membership将引发以下错误: ...... InnerException: System.InvalidOperationException HResult=-2146233079 Message
|
我正在使用Entity Framework 5开发ASP.NET MVC4应用程序,我正在使用Model First模式. 但是,如果我使用设计器生成的连接字符串,则Simple Membership将引发以下错误: ......
InnerException: System.InvalidOperationException
HResult=-2146233079
Message=The ASP.NET Simple Membership database could not be initialized. For more information,please see http://go.microsoft.com/fwlink/?LinkId=256588
Source=STD
StackTrace:
at SistemTempahanDewan.Filters.InitializeSimpleMembershipAttribute.SimpleMembershipInitializer..ctor() in c:UsersOrangDocumentsVisual Studio 2012ProjectsSTDSTDFiltersInitializeSimpleMembershipAttribute.cs:line 45
InnerException: System.ArgumentException
HResult=-2147024809
Message=Unable to find the requested .Net Framework Data Provider. It may not be installed.
Source=System.Data
StackTrace:
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString)
....
设计者生成的连接字符串(不起作用): <add name="STD" connectionString="metadata=res://*/Models.STD.csdl|res://*/Models.STD.ssdl|res://*/Models.STD.msl;provider=System.Data.SqlClient;provider connection string="data source=.SQLEXPRESS;initial catalog=STD;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> 连接字符串我手动添加(将工作): <add name="STD" providerName="System.Data.SqlClient" connectionString="Data Source=.SQLEXPRESS;Initial Catalog=STD;Integrated Security=True;MultipleActiveResultSets=True" /> 解决方法是的,SimpleMembership仅适用于SQL Server连接字符串,因此您需要在web.config中使用此类条目.不理想,但它的工作原理就像你说的那样……这可能是你的答案:Using SimpleMembership with EF model-first Jon Galloway的文章是关于SimpleMembership信息的绝佳资源,如果你还没有看到它:http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-3 – ViewBag/ViewData生命周期
- .net – 传递的主键值的数量必须与实体上定义的主键值的数量
- asp.net – 如何在iTextSharp中显示水平线
- asp.net-mvc – 如何为Html.TextBox帮助器指定属性,同时保持
- asp.net-mvc – 错误:无法在LINQ to Entities查询中构造实
- asp.net-mvc – 获取当前用户的角色
- asp.net-web-api – 从asp.net web api定制odata输出
- .net – 实体框架遇到的最大池大小4.3
- asp.net-mvc – 什么时候使用ViewData而不是ViewModels?
- 文件上传 – 是否可以在上传文件的asp.net webapi中进行模型
推荐文章
站长推荐
- asp.net – SignalR(Hub)可以发送除信号制作者之
- asp.net-mvc – thinktecture identityserver v3
- asp.net – 如果缓存破坏程序与内容不匹配,防止捆
- asp.net-mvc-3 – 我应该尝试使用MVC3和ASP.net的
- asp.net-mvc – “GenerateResource”任务失败,意
- asp.net-mvc – 单元测试ASP.Net MVC Action结果
- asp.net-mvc – WebApiConfig.cs和RouteConfig.c
- ASP.NET计算访问者,而不是机器人
- asp.net – 在成功登录时添加声明并在应用程序的
- asp.net – Visual Studio 2015的项目模板
热点阅读
