简体   繁体   中英

Database Project - Output dacpac

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM