user2840454
user2840454

Reputation: 89

.Net MVC Error The Entity Framework provider type could not be loaded

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.

Upvotes: 1

Views: 4846

Answers (2)

Ravi Khambhati
Ravi Khambhati

Reputation: 743

I got exactly the same error and I fixed by setting Copy Local property of below project reference to True.

  • EntityFramework
  • EntityFramework.SqlServer

Upvotes: 0

Steve
Steve

Reputation: 715

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.

Upvotes: 8

Related Questions