How do I deploy two ClickOnce versions simultaneously?

It might sound kind of lame, but the easiest way to do this is to have two EXE projects in your solution. The Main method of each of these will just call the Main method in your original EXE project (which you’ll have just switched over to being a DLL file).

This means that each EXE project can have its own ClickOnce publishing settings, as well as its own app.config file. This means you have different connection strings for the production and the test version.

Your other option (the one that might seem to make the most sense) is to use MageUI.exe to manually build the ClickOnce files, which would let you choose a different configuration file and publish location each time you ran the tool. There’s also a command line version (Mage.exe) so you could in theory automate this.

However, we found that the solution with two “runner” projects was far far simpler. I’d recommend you try that first.

Leave a Comment