MSI cant load .dll Error: 0x8007007E wix installer

0

I am trying do this in custom action wix:

string sqlConnectionString = @"Server=MyInstanceName;Trusted_Connection=True;MultipleActiveResultSets=true";
string script = "...";
Microsoft.Data.SqlClient.SqlConnection conn = new Microsoft.Data.SqlClient.SqlConnection(sqlConnectionString);
Server server = new Server(new ServerConnection(conn));
server.ConnectionContext.ExecuteNonQuery(script);

It work in console app but when I run msi it throw:

Failed to connect to server MyInstanceName. Could not load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

When I use Orca I dont see this .dll.

How can i repair that?

wix
asked on Stack Overflow Jul 30, 2020 by Silny ToJa • edited Jul 30, 2020 by Silny ToJa

1 Answer

0

This is a library problem Microsoft.SqlServer.Server. I changed library to write sql command on System.Data.SqlClient.

https://github.com/dotnet/runtime/issues/16048

answered on Stack Overflow Aug 10, 2020 by Silny ToJa • edited Aug 10, 2020 by Silny ToJa

User contributions licensed under CC BY-SA 3.0