I'm porting a library over to .NET Core 2.1 now that it has support for DbProviderFactory. For the most part it has gone fine - it compiles, but when run I get an error:
System.ArgumentException: 'The specified invariant name 'System.Data.SqlClient' wasn't found in the list of registered .NET Data Providers.'
I've used DbProviderFactories.GetFactoryClasses()
to check if there are any providers installed, and there doesn't appear to be (0 rows in the resulting table).
So I guess my question is, how can I install the data providers for .NET Core? I've got .NET Framework 4.5 on the machine and it is picking up the data providers without any issue. I don't want to install System.Data.SqlClient
as a Nuget for the local project, since that would add a dependency that would make the DbProviderFactory
irrelevent. That said, I have attempted to install System.Data.SqlClient
in a project that uses my library as a test, and it still isn't picked up.