.NET MVC错误实体框架提供类型无法加载 [英] .Net MVC Error The Entity Framework provider type could not be loaded

查看:216
本文介绍了.NET MVC错误实体框架提供类型无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

家伙。我学习一个开放源码的MVC项目。但建成后(通过)。我得到了运行时错误。

guys. I am studying a open source MVC project. But after building(passed). I got the run time error.

Server Error in '/' Application.

The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Source Error: 


Line 15: 
Line 16:        public MVCForumContext() : base("DefaultConnection") { }
Line 17:        public MVCForumContext(String nameOrConnectionString) : base(nameOrConnectionString) { }
Line 18: 
Line 19:        public DbSet<User> Users { get; set; }

Source File: c:\New folder\mvcForum.DataProvider.EntityFramework\MVCForumContext.cs    Line: 17 

难道你们给我一些指导?谢谢你。

Could you guys give me some guidance? Thanks.

推荐答案

检查数据库项目中引用。
你应该有和的EntityFramework上市EntityFramework.SqlServer。
如果没有尝试卸载并重新安装EF的NuGet包,它为我工作。

Check the references in the database project. You should have EntityFramework and EntityFramework.SqlServer listed. If not try uninstalling and re-installing the EF nuget package, it worked for me.

这篇关于.NET MVC错误实体框架提供类型无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆