0

I've a WinForms app and Database Project in the same solution.

How can I output dacpac of my database project in the WinForms output directory?

I created a routine using the Microsoft.SqlServer.Dac.dll to deploy the database. What I need to send in my deploy files to use this dll properly at stations that do not have a installed DACFramework?

1 Answer 1

2

It looks like you have two questions:

1 - How do you copy the dacpac to the bin directory of your winforms app?

A few ways:

  • Add a CopyFile msbuild task to the winforms project
  • Write a script you run when you want it copied
  • Manually?

2 - How do you use DacFx if it isn't installed?

You can copy the dll's from the dac\bin folder, you will also need to add the Microsoft.SqlServer.TransactSql.ScriptDom.dll that is in the sdk\assembly folder of a sql installation.

So the paths on my machine are:

  • C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin
  • C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies

warning dll's from microsoft are not normally licensed to be copied as you want so if you are distributing them to clients, you may be legally required to install the DacFx.msi but that is one for your lawyers :)

ed

2
  • Pretty sure that when I ran this by the SSDT team, they said you could get by with the installers, but that's still a far sight better than "you need a license of SQL Server for this machine", even if all it does is build or deploy. Commented Mar 18, 2016 at 14:06
  • yeah kevin cunnane confirmed earlier you can copy the dll's with the license.txt github.com/Microsoft/DACExtensions/issues/…
    – Ed Elliott
    Commented Mar 18, 2016 at 20:09

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.