5

We have a simple C# solution (VS 2012) that has a publish step/click once wizard - that uses ftp.

I've set up a jenkins build project to build this on SVN trigger. (via MSBuild)

I have NOT been able to get it to build (via MSBuild) the publish/click once installer and upload to my server. I have looked around and searched but i see no way to do this. It seems silly that this would be a manual step.

Hopefully this is something simple that I am overlooking.

Any command line app would be suitable - or if there are scripts that can do the same thing that VS2012 does in the wizard that is fine.

Tim
  • 20,184
  • 24
  • 117
  • 214
  • not clear - do you get any errors from Jenkins, or you just can't get the build process started? If you get errors - pls post them. – avs099 Nov 24 '13 at 11:52
  • I don't get errors - there is just no way that i have found to run the publish project from the command line. – Tim Nov 25 '13 at 04:15

1 Answers1

8

I guess you need this then:

msbuild /target:publish

see more here: Building ClickOnce Applications from the Command Line

this will create "publish" folder - which you have to copy to your server, or network share - whatever you are using for the distribution of your app.

Another problem you have to take care of is to increase the version before the build - you need to update csproj file eventually.

avs099
  • 10,937
  • 6
  • 60
  • 110
  • Yes, however that step does not do the same as what the GUI does - which is actually publish. And if I have to do both the ftp step and the update version step manually i don't see how this msbuild step is anything like the "publish". So I guess the answer is - you can't do it - you have to do it manually. (sorry for the rant) – Tim Nov 25 '13 at 21:26
  • i disagree with you - to me the actual upload process is clearly non-MSBUILD task - because it can be network share, Azure storage, blank CDROM... and uploading to FTP is just an extra step after publishing. – avs099 Nov 25 '13 at 21:44
  • regarding version update - again, to me that's something which should not be done "automatically" anyway - partly because you do want to have your version control system to be updated - so you can track errors to a certain commit etc. But after a quick googling i found this: http://codingeverything.blogspot.ca/2013/05/automatically-increment-minimum.html - looks like a decent solution to me, at least from a quick look. – avs099 Nov 25 '13 at 21:45
  • look at this one as well: http://stackoverflow.com/a/15434309/1246870 - looks like version can be a msbuild parameter. – avs099 Nov 25 '13 at 21:47
  • I understand what you are saying - and I agree - however then the "publish" in the GUI step should not do them either. There should not be a difference between invoking that step in the GUI vs invoking it from command line. That is the issue I am having. Doing it inconsistently is incorrect - on Microsoft's part. By the way, I upvoted your answer - might set it as the correct one too. – Tim Nov 25 '13 at 23:57