How do I publish multiple applications / processes with one clickonce deployment?

you need to reference second (worker) project from the first (main) project - and then, if you go to first project properties -> Publish -> Application Files, you should see second EXE as a dependency already. If not - just set "Publish Status" dropdown to "Include".

also - I'm not sure what's your goal, but take a look at my post here: Forced the application to have the administrator privileges - very similar issue with calling an app with admin privileges from ClickOnce app. Might save you few minutes.


If you don't want to have the user install more than one of the apps, then you don't want to have multiple ClickOnce deployments. What you really want is one deployment. So the ClickOnce app needs to be your main app, and you need to include the exe from the secondary app in the ClickOnce deployment. I would do this:

Add a copy of the exe to the ClickOnce project, set build action to 'content' and copy-to-output-directory to 'copy always'. Then do a build and check the Application Files dialog in the publish properties and make sure it shows up.

Now, if you can build the solution and it builds both projects, make sure it's building the project that creates the exe first. Then add a post-build command to the ClickOnce project that will copy it from the first project's output directory to the second project's output directory.

What will happen is it will build the first project, then it will build the C/O project (and copy the ClickOnce project's version of the exe to the output directory), and THEN it will copy the newest version of the exe from the other project into the ClickOnce project's output directory, and then it will create the deployment.

I'm not a msbuild expert, but the post-build command would be something like this.

COPY/Y "$(ProjectDir)....\otherproject\bin\release\mynew.exe" "$TargetDir)\mynew.exe"

This copies from the current project, up two levels, the other project, then the bin folder, then release + mynew.exe, to the build output directory. I'm not going to have the directory structure exactly right to the other project -- you'll need to set that yourself. But this gives you the general idea.