How to resolve an Entity Framework provider exception

I published the WCF project on the server, I also published the MVC application in the same field that uses WCF services.

When I try to log into my MVC application, this uses the wcf service, but I get this exception in the browser,

The Entity Framework provider type "System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer 'registered in the application configuration file for the ADO.NET provider with the invariant name" System.Data.SqlClient "failed to load. Make sure the name and that assembly is available for the running application.

This is an exception to the entity structure, but I assume that since my project already references EF in the dev environment, after deploying the project, the DLLs should contain an EF reference, but I'm not sure why I get this error.

I see this message because I have included includeExceptionDetailInFaults="True"

+8
c # asp.net-mvc entity-framework wcf publish
source share
4 answers

@FranciscoGoldenstein says! You do not need to install the Entity Framework in your console application or anything else, you just need to add the assembly reference EntityFramework.SqlServer.dll. You can copy this assembly from a class library project that uses the Entity Framework into the LIB folder and add a link to it.

In short:

  • Class Library Application:
    • Install Entity Framework
    • Enter data level code
    • The app.config file has all the configuration associated with the Entity Framework, with the exception of the connection string.
  • Create a console, network, or desktop application:
    • Add a link to the first project.
    • Add link to EntityFramework.SqlServer.dll.
    • app.config / web.config has a connection string (remember that the name of the configuration entry must be the same as the name of the DbContext class.

this is work for me! Hope this helps.

also try this link Failed to load Entity Framework provider type?

+11
source share

Destroy Entity Framework nuget and just reinstall, work for me.

+1
source share

I also had a similar problem

My problem was resolved by following these steps:

enter image description here

enter image description here

0
source share

Delete the bin folder and clean / rebuild your solution, as I suggested in my answer to another similar question .

0
source share

All Articles