We are using EntityFramework 6 with Code First. We have a console app that has no reference to EntityFramework but reads the connection string from its App.config. It call
Add "EntityFramework.SqlServer.dll" into your project bin folder will resolved your issue.
This is because EntityFramework.SqlServer.dll
is not copied into your project. Add that dll and it will hopefully work.You can find that from the project where you added datamodel.
I also had a similar problem
My problem was solved by doing the following:
For me it turned out that my provider reference in the web.config file was incorrect. I believe that the nuget package might not properly include the provider.
I replaced my provider with this and it worked:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>