You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x64.dll' #1318
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" />
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
@poyadav2001 thanks for bringing this up. Are you accessing the driver inside a library and trying to use that library inside another project? In other words I want to know the architecture of your application and specifically where it uses M.D.S. A sample repro, something with minimal code that can help us to have a better understanding of the issue you are facing with, would be appreciated as well.
System.Data.SqlClient is shipped with the framework, hence it has all required dependencies available to itself. However Microsoft.Data.SqlClient is not benefiting from that privilege.
Can you try creating a standalone application using similar architecture and try to run some tests? The SNI DLLs are downloaded transitively to your bin folder when restoring/building the project and project properties can conflict with this transitive loading.
If you can reproduce this issue in a standalone app, we can investigate and assist further. That will also give you insights when you compare with a working application to figure out why in a particular project SNI DLLs are not downloading.
Same issue here. Just created VSIX project, added Microsoft.SqlServer.SqlManagementObjects 161.47021.0 and after trying to create connection with DB i get this exception.
@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.
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.
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.
In my case ,I am updating from System.Data.SqlClient to Microsoft.Data.Sqlclient to configure Azure AD Managaed Identity and make my DB connection string password less
In my case ,I am updating from System.Data.SqlClient to Microsoft.Data.Sqlclient to configure Azure AD Managaed Identity and make my DB connection string password less
Activity
JRahnama commentedon Oct 5, 2021
@poyadav2001 thanks for bringing this up. Are you accessing the driver inside a library and trying to use that library inside another project? In other words I want to know the architecture of your application and specifically where it uses M.D.S. A sample repro, something with minimal code that can help us to have a better understanding of the issue you are facing with, would be appreciated as well.
System.Data.SqlClient is shipped with the framework, hence it has all required dependencies available to itself. However Microsoft.Data.SqlClient is not benefiting from that privilege.
JRahnama commentedon Oct 5, 2021
More to add: there are known issues similar to yours such as issue #745 or #1146.
poyadav2001 commentedon Oct 5, 2021
Link to our repo: https://microsoft.visualstudio.com/Universal%20Store/_git/SC.CST.Dunning
The project: https://microsoft.visualstudio.com/Universal%20Store/_git/SC.CST.Dunning?path=/Product/Billing/shared/Common/Common.csproj&version=GBu/poyadav/FileCopy&_a=contents
I have added a reference to M.D.S. in the project that is using it directly to access databases. It's not a deployment issue, I am getting this error on my local machine.
JRahnama commentedon Oct 5, 2021
I believe I have access issue. I have tried reloading/refreshing the page but no luck.

cheenamalhotra commentedon Oct 5, 2021
Hi @poyadav2001
Can you try creating a standalone application using similar architecture and try to run some tests? The SNI DLLs are downloaded transitively to your bin folder when restoring/building the project and project properties can conflict with this transitive loading.
If you can reproduce this issue in a standalone app, we can investigate and assist further. That will also give you insights when you compare with a working application to figure out why in a particular project SNI DLLs are not downloading.
JRahnama commentedon Jan 12, 2022
@poyadav2001 is this still an issue?
mnaharnowicz-fp commentedon Jun 4, 2022
Same issue here. Just created VSIX project, added Microsoft.SqlServer.SqlManagementObjects 161.47021.0 and after trying to create connection with DB i get this exception.
ErikEJ commentedon Jun 4, 2022
@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.
kristianjaeger commentedon Jun 7, 2022
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.
SynapseScribe commentedon Jan 26, 2023
might be related to #727
I went to add/remove programs and ran repair on it, which fixed the problem
RaghavaAkula394 commentedon Apr 6, 2023
RaghavaAkula394 commentedon Apr 6, 2023
In my case ,I am updating from System.Data.SqlClient to Microsoft.Data.Sqlclient to configure Azure AD Managaed Identity and make my DB connection string password less
Aashishkebab commentedon Apr 26, 2023
Did you ever figure this out?
jons-bakerhill commentedon May 12, 2023
@Sajgoniarz Were you ever able to figure out the VSIX extension issue loading the SNI DLLs?
SirMrDexter commentedon Nov 24, 2023
After I installed the latest OLE DB driver (19.3.2) it seems to be fixed. Not sure if this is reason.
@Aashishkebab
cheenamalhotra commentedon Nov 15, 2024
Closing as stale, no active known issue or repro available.