I have a ClickOnce project that I'm publishing on DevOps. I've set the MSBuild Arguments
property for the WinForm solution's build stage in DevOps to /target:Publish
in order to trigger the creation of all the ClickOnce files:
However, that solution also contains an SSDT project, and adding the /target:Publish
setting appears to then cause the build process to try publish the SSDT too. That then fails with the error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1808,5): error MSB4044: The "SqlPublishTask" task was not given a value for the required parameter "SqlPublishProfilePath"
Presumably it's failing because there's no publish profile specified in a build parameter for the SSDT to use.
I don't want MSBuild to publish the DacPac to a server, I just want it to create the DacPac. How can I stop the /target:Publish
triggering the SSDT publish, is there another build argument I can add to stop that happening?
Notes on what I tried so far to solve this, none of which has worked:
- Read about the -target switch in the MS Build official docs in the MSBuild command-line reference and in the MSBuild targets section.
- Looked at the code in the .csproj file to try and identify the 'Publish' sections - think Publish must also call Build.
- Unticking Deploy for the SSDTs in the solution configuration in VS
- Adding entries for False in the Release and Deployment configurations in the SSDT's .csproj file, and also setting that to false for the Debug configuration (as per this question)
- Setting MSBuild to only publish one project using the MS Build arguments on DevOps (as per this answer)
- Considered pulling the ClickOnce publish out into an entirely separate stage using Mage.exe as per this Walkthrough: Manually deploy a ClickOnce application
- Tried to create a publish profile that doesn't actually publish, so that the publish stage can complete (was looking at this question for ideas on that and also the official documentation for SqlPackage.exe)