1

I need to pulbish ClickOnce application using C# code (using Microsoft.Build). I've searched quite a long time without finding good know-how of the procedure.

Using MAGE.EXE or publishing it from Visual Studio is not an option.

Since the documentation on Microsoft.Build is quite poor and there are no real examples, I'm really guessing on how the procedure will look like.

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
Asen Mitov
  • 37
  • 4
  • Check this http://stackoverflow.com/questions/1375764/publish-clickonce-from-command-line – Kiru Mar 27 '12 at 14:21
  • Thanks for the comments. I am quite familiar with most of the ways to create ClickOnce installation, but as I said in the title, I need to do it programatically, not by invoking some external process like msbuild.exe, devenv.exe or mage.exe. – Asen Mitov Mar 27 '12 at 14:31
  • 1
    @AsenMitov - Why recreate something that already exists? You have to explain the reason its not an option, you can call these tools from "code" and just pass the command arguments, trivial really. – Security Hound Mar 27 '12 at 15:47
  • @Ramhound: It is not so simple to explain why I need such solution. Let's say that this is the requirement (I do not make the requirements). I really find offensive such comments, because as mentioned in the post I am aware of mage.exe and other tools. I am also aware that I can call these tools from the code, but OBVIOUSLY this is not the solution I need. – Asen Mitov Mar 27 '12 at 16:44
  • 1
    @AsenMitov - You should be able to explain what the requirement is. If you cannot then its time to get explain to the person who made the requirement its still, I find i offensive that your asking such a question without proper research. – Security Hound Mar 27 '12 at 16:46
  • I'm with Ramhound. Is it that you can't use these tools from code, or is it that you are suffering from Not Invented Here syndrome? – Judah Gabriel Himango May 05 '12 at 18:09
  • @Judah Himango & Ramhound: This thread is now irrelevant. I want to thank you both guys, I wasn't gonna make it without your help. It is obvious, from the comments you made, that you, indisputable, are the most valuable professionals. – Asen Mitov May 06 '12 at 19:47
  • Asen, we're not trying to be jackasses. We're trying to help you. Our best help is: use the command line tools and invoke them through code. We say this because you should use what's already built. If you're not going to do that, you'll have plow new ground here; build a ClickOnce deployment tool entirely from scratch, without using any of the framework SDK tools. It's probably possible to do that, but inadvisable, and probably never done before outside of Microsoft. You might also check the Mono project; they may have done something like this. – Judah Gabriel Himango May 08 '12 at 20:36
  • There is no final solution. What I've came up with is a combination between mage.exe, batch (*.bat) file scripts and custom command line utilities for *.manifest and *.application manipulations. Quite ugly, but it is working for quite a time without problems. I didn't have the time to experiment with Microsoft.Build library. – Asen Mitov Oct 22 '12 at 14:31
  • can you show any scripts, command line tasks, code aobut it ? – Kiquenet Jun 25 '19 at 07:42
  • msbuild /target:publish. https://learn.microsoft.com/en-us/visualstudio/deployment/building-clickonce-applications-from-the-command-line?view=vs-2019 – Kiquenet Jun 25 '19 at 08:07

0 Answers0