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?
2 Answers 2
=======================================
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 !!!
-
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!MatthewT– MatthewT11/22/2013 02:24:00Commented Nov 22, 2013 at 2:24
-
1Thanks both of you - I was also missing EntityFramework.SqlServer.dll. Removing and re-adding the references seemed to fix it.Adam Plocher– Adam Plocher04/07/2014 17:00:10Commented 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 ?Anil C– Anil C06/02/2014 08:07:25Commented Jun 2, 2014 at 8:07
Copy "EntityFramework.SqlServer.dll" in bin directory on server or add it to the solution as reference and republish.
Explore related questions
See similar questions with these tags.