Entity Framework Provider type could not be loaded?
Same problem, but i installed EF 6 through Nuget. EntityFramework.SqlServer was missing for another executable. I simply added the nuget package to that project.
The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' could not be loaded
I fixed this by installing entity framework in the WCF host site.
That worked.
How do I solve The Entity Framework provider exception
@FranciscoGoldenstein saying ! You don't need to install Entity Framework in your Console application or whatever, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to it.
In summary:
- Class Library application:
- Install Entity Framework
- Write your data layer code
- app.config file has all the configuration related to Entity Framework except for the connection string.
- Create a Console, web or desktop application:
- Add a reference to the first project.
- Add a reference to EntityFramework.SqlServer.dll.
- app.config/web.config has the connection string (remember that the name of the configuration entry has to be the same as the name of the DbContext class.
it is work for me ! I hope it helps.
also try this link Entity Framework Provider type could not be loaded?
Entity Framework provider error
Have you found a solution for this problem? Otherwise you could take a look here: Entity Framework Provider type could not be loaded?
Most of the time when I see this exception it's because the web application doesn't have Entity Framework installed (and / or missing the EntityFramework.SqlServer.dll
).
So to give an example, if you have 2 projects in a solution:
- WebApp
- DataAccess
and with Entity Framework installed in the DataAccess project. When wanting to call a method on a class (for example a repository) from the DataAccess project within the WebApp, 2 things are needed:
- WebApp needs a reference to DataAccess
- Webapp also needs EF to be installed
When DataAccess has EF installed and then added as a reference to WebApp, the WebApp project will (normally) also install EF. Sometimes in unexpected situations the installation of EF in the WebApp fails. Therefore not adding the needed references and showing the exception message you mentioned. Hopefully this answer will help some others.
Entity Framework Provider type could not be loaded? in QA; works in Test
Make sure that the EntityFramework DLL was added to the ASP.NET MVC Project. All projects that call database methods must have the EntityFramework's DLL.
Related Topics
How to Animate a Line on a Canvas in C#
Why Is a Dictionary "Not Ordered"
Replace "\\" with "\" in a String in C#
A Generic List of Anonymous Class
How to Drag and Drop Files into an Application
How to Check for Permissions to Write to a Directory or File
Correct Way to Override Equals() and Gethashcode()
How to Use Openfiledialog to Select a Folder
How to Select Distinct Rows in a Datatable and Store into an Array
Way to Have String.Replace Only Hit "Whole Words"
C# Regex Split - Commas Outside Quotes
Catch Exception That Is Thrown in Different Thread
How to Find Control in Templatefield of Gridview
How to Get Difference Between Two Dates in Year/Month/Week/Day