SqlClient: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x64.dll'

Describe the bug

A clear and concise description of what the bug is. {“Unable to load DLL ‘Microsoft.Data.SqlClient.SNI.x64.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)”}

To reproduce

Updated project that targets .NET Framework 4.7.2 to use Microsoft.Data.SqlClient from System.Data. SqlClient. Cannot find the Microsoft.Data.SqlClient.SNI.x64.dll under bin folder. The dll is not automatically added by Microsoft.Data.SqlClient <PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />

image

Further technical details

Microsoft.Data.SqlClient version: (found on the nuget or Microsoft.Data.SqlClient.dll) : 3.0.0 .NET target: (e.g. Framework 4.7.1, Core 2.2.2) .NET Framework 4.7.2 SQL Server version: (e.g. SQL Server 2017) Operating system: (e.g. Windows 2019, Ubuntu 18.04, macOS 10.13, Docker container) Windows 2019

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I just repro-ed this today with Nuget Microsoft.Data.SqlClient 4.1.0 and the implicitly installed Microsoft.Data.SqlClient.SNI dependency of 4.0.0. This is using .NET Framework 4.7.2 on Windows 2016 Datacenter. "Exception": "System.DllNotFoundException: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).
The files are included in a VisualStudio build (2019) but not Octopus package for some reason.

Update: a workaround seems to be to use System.Data.SqlClient namespace instead which is part of the .NET Framework.

@Sajgoniarz hardly same issue, as a vsix is a dll file hosted and loaded in the Visual Studio process. Suggest you create a new issue with reproduction details or even better a sample project.