LINQPad 5 - Issues using Microsoft.Data.SqlClient in fretje.SqlBulkTools.
I'm trying to test out the library fretje.SqlBulkTools in LINQPad 5 since I plan to implement it in an existing .NET Framework project. When I load this particular project which targets .Net Standard, it also requires the use of Microsoft.Data.SqlClient instead of System.Data.SqlClient. This causes two issues.
1) I can't seem to remove the 'implicit' reference to System.Data.SqlClient - I have to fully qualify Microsoft.Data.SqlClient.* in my test code.
2) Even when I manually fully qualify, I get an error message when trying to run the query.
Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I attempted to do the same thing in Visual Studio 2019 and it worked without issue, so there's something about this interaction that specifically doesn't work in LINQPad. Thanks!
Comments
LINQPad 5 has only limited support for Microsoft.Data.SqlClient. Have you tried adding an explicit NuGet reference to this package?
Yeah, I had to directly reference it to create the SqlConnection.
I did find that the fretje.SqlBulkTools offers a version that uses System.Data.SqlClient instead and it works okay so not really an issue anymore for my particular use case.