0

I am trying to understand why is my WindowsForm app publish behaving differently, when done via command line and via Visual Studio's Publish.

The differences are:

  1. In my command line publish, a copy of the .exe is placed in the top-directory publish folder, while it is not there, when published via VS
  2. In my command line publish, the .application file is missing in the [Application Files] folder, while it is there when published via VS

A screen shot illustrating the exposed above: enter image description here

Anyone has any idea why does this happen ? I have tried playing with the publish settings, but still without success.

Below is what my command line statement looks like (ran via Jenkins): enter image description here

Veverke
  • 9,208
  • 4
  • 51
  • 95
  • Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? I will keep follow. – Leo Liu Jan 18 '18 at 10:00
  • Hi Leo, thanks for your cooperation. I gave you an upvote, but I did not follow the instructions in customizing msbuild targets (build steps). I am under the pressure of a new release and this question arose from what I thought could be related to my deployment issues, but apart from no signs of it being an issue at all, it is NOT related to the problems I have been trying to solve, hence I did not follow up anymore. – Veverke Jan 18 '18 at 12:25

1 Answers1

1

Explanation on specific differences between my click once publish when done via command line and from Visual Studio

That because some features are done by Visual-Studio and not by the MSBuild command line. So the click-once-deployment behaves differently when it's executed from the command-line.

When you publish via command line, only Project.exe and Setup.exe are copied to the deployment folder. You can switch the deployment folder by property PublishDir:

msbuild "ProjectName.csproj" /target:publish /p:Configuration=Release;PublishDir=D:\TestPublishFolder

enter image description here

When you publish from Visual Studio, Visual Studio will do some more features, including Application Files folder and .application file into deployment folder.

If you want to have the same publish result as Visual Studio when you publish via command line, you can custom target to achieve it.

See ApplicationFiles folder missing when ClickOnce publish with command line for more detailed info.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135