Entity Framework data provider not found, entityclient

Perry picture Perry · Jun 20, 2013 · Viewed 8.8k times · Source

First off, I've found many questions and many answers related or perceived identical to my issue however nothing seems to be working out for me.

I have a brand new templated MVC4 website, a brand new database in a fresh install of sql server 2008 r2. I ran aspnet_regsql on the database and created all the tables I created the .edmx model which generated the connectionstring in my web.config.

<connectionStrings>
  <add name="TestEntities" connectionString="metadata=res://*/Models.Test.csdl|res://*/Models.Test.ssdl|res://*/Models.Test.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=WEBSRV\SQLEXPRESS;initial catalog=Test;persist security info=True;user id=Test;password=Test#1337;multipleactiveresultsets=True;App=EntityFramework&quot;"  providerName="System.Data.EntityClient" />
</connectionStrings>

Building the website returns me the error Unable to find the requested .Net Framework Data Provider. It may not be installed.

There is no self closing <DbProviderFactories/> in my machine.config The same issue happens wether I run the website locally in the visual studio web host or on my webserver's IIS. I have not installed any NuGet packages

Why do I get this error?

Answer

Perry picture Perry · Jun 21, 2013

Right, I figured out the issue.

You cannot use that connectionstring for anything else than the edmx connection. The way I have it in my web.config makes the website use that same connectionstring for the membership stuff too, which is not compatible with the System.Data.EntityClient provider and needs the System.Data.Sqlclient in my case. Adding a second connectionstring, minus the Entity Framework stuff in it and having that referenced by the membership provider attributes in the web.config removes all errors and allows the page to render and request stuff from the SQL server.

Nightmare over, can return to work on my website. o/