[wix-devs] Wix Toolset doesn't pick up a dependent dll

Paul Elkin pelkin at zoll.com
Fri Aug 13 07:52:56 PDT 2021


Hello,
I am using WIX Toolset v3.11.1.2318. Visual Studio 2019.
I have a WIX Installer project called TCEDBInstall, which calls WixDBInstall.CustomAction project implemented with .NET Framework 4.7.2. WixDBInstall.CustomAction should connect to the SQL Server and create a new DB. For that purpose it uses Microsoft.SqlServer.SqlManagementObjects NuGet package. This package has dependency on Microsoft.Data.SqlClient NuGet package, which has the dependency on Microsoft.Data.SqlClient.SNI NuGet package. Microsoft.Data.SqlClient.SNI puts 2 DLLs into the bin folder of the WixDBInstall.CustomAction project: Microsoft.Data.SqlClient.SNI.x64.dll and Microsoft.Data.SqlClient.SNI.x86.dll. TCEDBInstall, which builds into MSI, has reference to WixDBInstall.CustomAction: "...\bin\Debug\WixDBInstall.CustomAction.dll".
When Installer is being executed, the log file for TCEDBInstall.msi shows the following, when execution comes to WixDBInstall.CustomAction method:
"Database connection not possible. Database treated as not existing. Exception: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
It looks like these DLLs are not being picked up, because I don't call them directly, but as a second level dependency.
I tried to reference the NuGet packages in TCEDBInstall, but I failed because it is an Installer project and doesn't have .NET Framework required by Nuget packages. I tried to add a reference Microsoft.Data.SqlClient.SNI.x86.dll, but it doesn't have an entry point. How can I make the installer to pick up these DLLs and place them along with the WixDBInstall.CustomAction.dll?


Regards,
Paul Elkin



More information about the wix-devs mailing list