Tools: Visual Studio 2015, SSDT
I have an Visual Studio SQL Project which works fine on it's own. I run my build and the dacpac file is in debug\bin\*.dacpac as expected.
The problem is this SQL project is part of a WinForms solution.
I have included the SQL project as a project reference in the Winforms Project.
It looks like visual studio only copies dlls from project reference bin folders into the output path bin\debug folder.
How can I configure Visual Studio to ALSO copy the dacpac file to the winform project's bin\debug folder (outputpath)?
With other files that are included in the project itself, this is easy. I can just edit the file properties to copy always to output path. For BIN output you cannot do that since the dacpac file is a build output, not part of the project itself.
You can add a copy task in the
Pre-build event
of Winforms Project or in thePost-build event
of SQL project.Post-build event in SQL project:
Pre-build event in Winform project:
Here are some commonly used switches with
xcopy
:Hope this help.