4

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?

asked Oct 25, 2013 at 18:58

2 Answers 2

7

=======================================
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 !!!

answered Oct 25, 2013 at 20:37
3
  • 3
    +1 for the info that helped me. In my case, EntityFramework.SqlServer.dll was not getting published. Once I got this file onto the server, everything worked! Commented Nov 22, 2013 at 2:24
  • 1
    Thanks both of you - I was also missing EntityFramework.SqlServer.dll. Removing and re-adding the references seemed to fix it. Commented Apr 7, 2014 at 17:00
  • I am also facing the same issue but not able to resolve it as per the steps mentioned above. Is there any other solution? I am getting this problem at a specific server and its working fine on another server. Any suggestions ? Commented Jun 2, 2014 at 8:07
1

Copy "EntityFramework.SqlServer.dll" in bin directory on server or add it to the solution as reference and republish.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.