I have the following MVC project structure:
BLL
DAL
CommonClasses
Web
i'm using Entity Framework 6.0.2. The web project has a reference to the BLL and CommonClasses project. BLL has a reference to DAL and CommonClasses. Both BLL and DAL also have references to EF 6.0.2, added via Nuget. Anytime my code tries to do anything with Entity Framework I get the error below:
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.
I'm a bit lost on what's happening. I have checked and there is a reference to EntityFramework.SqlServer in the DAL and BLL projects. All projects also have a reference to System.Data.
The app.config file in both the DAL and BLL proejcts has the below line:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>