Firstly System.Data.SqlClient
isn't going anywhere. It is part of the core framework and will remain supported until well after .NET 6.0 is out of support. It has been deprecated in lieu of Microsoft.Data.SqlClient
however the newer library has lots of issues so if you run into problems then stick with the old library.
At the top of the list includes the fact that the binary relies on native binaries that must also be part of your deployment and are locked while the process is running. This causes problems for web apps that aren't stopped before trying to be deployed.
Another issue is that it currently relies on Azure binaries even though it doesn't actually require Azure. The issue is a low level dependency that even MS said they are not sure how to remove.
Yet another issue is that it doesn't support all the more advanced SQL types yet. You should therefore review what you need to ensure it meets your purpose before switching.
In regards to the actual issue you're having, you won't be able to use it. I should point out that Microsoft.ApplicationBlocks
has been deprecated for a while. If you have any code that relies on that library then you should be looking to replace it. The library hasn't been supported for over 8 years and doesn't work with newer frameworks (aka .NET Core+).
Even if the library were supported, the library is based upon System.Data
. Therefore all the types it uses requires the types from System,.Data
. The versions provided in Microsoft.Data
, while sharing the same name, are not the same types and therefore not interchangeable. You cannot use Microsoft.Data.SqlClient
with the app block library. Microsoft.Data
is a complete rewritten of the data libraries and only share the common System.Data
interfaces in common. Since the app block library was specifically written to target System.Data.SqlConnection
it cannot be used with any other library. If you really, really need this functionality then you'll have to grab the source code, update it to work with Microsoft.Data.SqlClient
and then add it to your own code.