Reputation: 103
I'm invoking DacServices APIs to deploy DACPACs, which requires an assembly reference of Microsoft.SqlServer.Dac. The target machine on which i run my installer could have SSDT/SQL installed on D drive or maybe a higher version of SQLServer could be installed.
How do i dynamically get the Microsoft.SqlServer.Dac assembly file path on target machine when using DacServices to deploy (We'd have the same issue if we were to use SqlPackage.exe since I need to dynamically find out the 120/DAC/bin or 130/DAC/bin folder on the target where i run my installer)?
Or if anyone can suggest any other solution to this issue so that the same exe can work of different machines/environments, that would be great.
Upvotes: 1
Views: 1201
Reputation: 3507
Modern versions of DacFramework.msi note the install location in the registry under HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Data-Tier Application Framework\InstallLocation.
However, it would be better to include the DacFramework assemblies in your installer and call that code. The Data-Tier Application Framework is licensed by Microsoft as "redistributable" code.
Upvotes: 1