Microsoft.Data.SqlClient.SNI not deployed along with ClickOnce
See original GitHub issueDescribe the bug
The nuget package Microsoft.EntityFrameworkCore.SqlServer v3.1.2 needs the reference to Microsoft.Data.SqlClient.SNI v1.1.1. The SNI package is automatically added to the project when referencing the SqlServer v3.1.2 which is expected. When building the solution, the directories x64 and x86 are created as expected and everything works fine when started from the \bin\debug and \bin\release folders.
To reproduce the issue
When deploying the solution using ClickOnce, both directories (x86 and x64) are not included so that the application does not work anymore as it lacks the SNI.dll reference. I cannot see a way to solve the issue since I cannot include the reference under
ProjectName > Publish > Application Files...
I saw this (fixed) issue but for ClickOnce, it does not seem to be fixed.
Expected behavior
When deploying the application using ClickOnce, the x64 and x86 directories including the native SNI.dll libraries are copied to the respective version directory inside the “Application Files” directory and referenced properly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:51 (12 by maintainers)

Top Related StackOverflow Question
For those who encountered the same issue I have, I stored SNI.dll to publishing directory and I check if it exists at each application start. If it doesn’t exist I download them to the application directory. That sounds to be the UGLIEST HACK I ever done ! Hope to drop that code very soon. Here is my sample code for reference this has to be before any connection to database so in main static method it’s okay @Siam1205 :
We are experiencing the same bug. To reproduce: