DACPAC not including composite objects

3.9k views Asked by At

I have a VS2012 database project which includes tables, stored procs, views etc.

I then have a second database project which contains a database reference to the first project. I have ensured that the "Include composite objects" options is selected from the "Project Properties -> Debug -> Advanced" menu.

When I build the second project and take the resulting DACPAC file and deploy it through SSMS2012 it doesn't create the firsts project's objects.

Am I missing something? Why don't the composite objects get included in the DACPAC?

2

There are 2 answers

0
SmudgerDan On BEST ANSWER

As Peter Schott said in the comments above, I needed to deploy both outputted Dacpacs in order, with the referenced database first.

You cannot do this through SSMS, it won't allow you to deploy two different Dacpacs to the same database. But it is not a problem through SQLPackage.

0
Weissvonnix On

I had the same problem when publishing dacpac with dacfx. As answered here, I had to activate the "Include composite objects" option. But that's not all. When you compile your project, Visual Studio generates two dacpac files in your "second" project. You must put both files in the same directory when you deploy the second project.

Hope that helps, for me it did ;-)