c# - How to include dacpac file from build in Solution Output Path -


tools: visual studio 2015, ssdt

i have visual studio sql project works fine on it's own. run build , dacpac file in debug\bin\*.dacpac expected.

the problem sql project part of winforms solution.

i have included sql project project reference in winforms project.

it looks visual studio copies dlls project reference bin folders output path bin\debug folder.

how can configure visual studio copy dacpac file winform project's bin\debug folder (outputpath)?

with other files included in project itself, easy. can edit file properties copy output path. bin output cannot since dacpac file build output, not part of project itself.

how can configure visual studio copy dacpac file winform project's bin\debug folder (outputpath)?

you can add copy task in pre-build event of winforms project or in post-build event of sql project.

post-build event in sql project:

xcopy /y "$(projectdir)$(outdir)*.dacpac" "$(solutiondir)yourwindowsformsprojectname\$(outdir)" 

pro-build event in winform project:

xcopy /y "$(solutiondir)yoursqlprojectname\$(outdir)*.dacpac" "$(projectdir)$(outdir)" 

here commonly used switches xcopy:

/i - treat directory if copying multiple files /q - not display files being copied. /s - copy subdirectories unless empty. /e - copy empty subdirectories. /y - not prompt overwrite of existing files. /r - overwrite read files. 

hope help.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -