I have 2 projects in my solution:
- An ASP.NET Core 2.2 Web API project
- A .net framework class library
In my class library I have created my entities using a database-first approach. In my Web API project, I am referencing the class library.
When I run the application, an exception gets thrown at this point:
return entities.IP_Types.ToList();
This is the exception below:
System.ArgumentException: 'The ADO.NET provider with invariant name 'System.Data.SqlClient' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.'
My app.config file seems to be correctly set up. I have the following code in it:
<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>