'How to use msbuild in Jenkins pipeline for ClickOnce applications to generate deployment htm

I am trying to build a Windows application using msbuild in Jenkins. Along with build I need to perform task similar to "Publish" in Visual Studio so that the deployment htm file also gets generated. I tried using /t:Publish with msbuild, but it does not generate the required htm file.

Also went through the below link which is about using msbuild from the command line. It talks about using /t:Publish but my csproj file does not have a publish target itself.

https://docs.microsoft.com/en-us/visualstudio/deployment/building-clickonce-applications-from-the-command-line?view=vs-2022

Looking for some insights here.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source