I was reading the answer to this question about the Microsoft.Data.SqlClient
and System.Data.SqlClient
which states that "Mixing up data providers isn't fun and should be avoided when possible." I'd like to know what kind of problems could be caused by this?
There are two scenarios I've considered, the first is referencing both packages directly in a project. I can see issues sharing a SqlConnection
in this instance, or issues passing different implementations of SqlParameter
, but am not sure what else would be painful.
The second is referencing one package, but having a reference to the other via a 3rd party dll. Could problems be caused in this latter case, and if so how?
My secret motivation for this is that we are experiencing odd behaviour that looks like connection leaks in our Hangfire service, and I am wondering if maintaining references to both the Microsoft.Data.SqlClient
and System.Data.SqlClient
packages is a possible cause.