@Siva palla's answer solved this exact same issue for me. Here are the complete set of changes we made to get this working.
Changes in Visual Studio
Originally I was using a single configuration called 'Deployment' that was set to deploy both our WinForms project and our SQL project (VisionShellWin is the WinForms project, the two Vision.SQLMigration projects are the SSDT projects) so everything below is based on changes to Deployment. For most people you'll have Release instead of Deployment, all of the below should still work fine, just substitute in Release for Deployment:
![enter image description here]()
To separate that single configuration in two I created a new configuration:
![enter image description here]()
I set that new deployment to copy its settings from the old Deployment configuration and not to create new configurations for each of the projects (the existing project level Deployment ones are fine):
![enter image description here]()
In that new deployment I then unticked the boxes to Build and Deploy the database projects:
![Configuration with SSDT projects not ticked to Build]()
I then did the exact same thing again to create a Database specific deployment:
![enter image description here]()
And in that one I unticked everything except the database files:
![enter image description here]()
That's everything needed in Visual Studio, so I committed all of that and synced it back to DevOps.
Changes in Azure DevOps
In DevOps I cloned my existing Visual Studio Build stage (called 'Build Winforms solution') and renamed the clone to Build Databases:
![enter image description here]()
I added two new build variables in the Variables tab, named ClickOnceBuildStageConfiguration and DatabasesBuildStageConfiguration with their values set to the names of the new configurations we just created in VS:
![enter image description here]()
And then I changed the WinForms build stage to use the new ClickOnceBuildStageConfiguration variable - note that we still have the /T:"VisionShellWin" /target:Publish MSBuild Arguments needed for ClickOnce set:
And the new Build Databases stage to use the databases variable - note that we don't have any MSBuild Arguments:
![enter image description here]()
Finally, in addition to the copy stage I already had for copying the ClickOnce application files into the drop artifact:
![enter image description here]()
I also added a Copy Files stage (called 'Copy Dacpacs') to copy the DacPac into the drop too:
![enter image description here]()
Once you've done all of that, you should end up with a build that works and an artifact that contains both the ClickOnce files and the DacPacs
![enter image description here]()