1

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.

ajeesh k
  • 93
  • 8

1 Answers1

1

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.

Steven Green
  • 3,387
  • 14
  • 17
  • Thanks for that Steve! Couldnt get the Install Location folder for 2014 and 2016 on our machines using HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Data-Tier Application Framework\InstallLocation. I see a DACFramework under Microsoft SQL Server, but it doesnt have an Install Location – ajeesh k May 26 '17 at 04:37
  • For the x86 (32-bit) version of DacFramework.msi you can check HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server\Data-Tier Application Framework\InstallLocation – Steven Green May 26 '17 at 17:55