SF Developer SF Developer -4 years ago 188
ASP.NET (C#) Question

Windows 2012 SERVER - No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

I have a WebAPI 2 using EF6 on my local machine and it works perfectly.
When I PUBLISH the solution and upload it to the server, I get the following error:


System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors:
Database.FooModel.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file.


Note:

I see many posts about fixing the development machine but my problem is not that. My problem lies when I upload the code to the Windows 2012 server.

Question:

How do you ensure that the SERVER gets the proper settings when uploading a EF6 solution?

I already updated the server to DotNet 4.5.1, what else should I install on the server?

Answer Source

=======================================
SOLUTION: Unfortunately, I had to restart a new application and quickly copy the files and that solved the problem. Now the server runs perfectly. If I look at the Published files (prior and after), I see a newer "EntityFramework.dll" file version and a new "EntityFramework.SqlServer.dll" file on the bin directory. I also noticed that "Microsoft.Data.Edm.dll and Microsoft.Data.OData.dll" are not on the new version.

Not sure this info can help ..but at least we know that we can create a new application and that works !!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download