Take the 2-minute tour ×

We are thinking about using ClickOnce for deployment. I am not sure if this can be easily achieved while using ClickOnce. We create the ClickOnce installer and distribute to clients, and each client will put the ClickOnce installer on their own network. Each user of the client will run it from their local network.

The application has some settings in the configuration file. Each client will have their own setting (all users under the client will use the same settings). My understanding is once the ClickOnce package is created, clients can not change the configuration file to set their own settings, or the ClickOnce has to be re-signed.

Is my understanding correct? Is there a workaround? Can the application access the update location for files not included in the ClickOnce manifest?

share|improve this question
add comment

4 Answers

up vote 2 down vote accepted

If you are targeting the 3.5 Framework you don't have to sign your ClickOnce deployments. Make sure "Sign the ClickOnce manifests" is unchecked on the "Sign" tab of your project properties. This will allow you to edit the .application file after the deployment is created. Change the codebase attribute of the deploymentProvider tag...
<deploymentProvider codebase="http://theirserver/.../Foo.application" />

This won't solve the application setting issue though. If you edit a file you are deploying, the hash for the file must be regenerated.

Do you know what the client setting needs to be? If so, maybe you could have separate config files for each client and do something with a pre-build event to copy config files around?

Does the setting have to be in the client config file? Could you store the setting on the server and pass it through a url parameter or get it with a web service call after the application starts?

If these things won't work, you could provide your clients with a simple script (probably using Mage) so they could regenerate and resign the manifests (with their own certificate) after they edit the deployment.

share|improve this answer
thanks. What will happen if a file (like the config file or a custom file) is not included in hash? –  Qstonr Jan 12 '10 at 14:18
Each file being deployed is hashed. The hashes are all stored in the .manifest file. You don't have a choice about hashing files, it's how click once works. It's a security measure that safeguards against deployments being tampered with –  whatknott Jan 12 '10 at 14:48
add comment

We are using ClickOnce in our company, and I had to publish a package per URL. However, in your case you could always publish with a DNS name, and tell your clients to use the same DNS name on their network, and it should always work.

share|improve this answer
So clients to use the same dns name, and the settings to be passed through URL parameter? –  Qstonr Jan 12 '10 at 14:27
add comment

One more not very good solution:

You can place configuration files to different "optional groups" and download a specific configuration by manually using ApplicationDeployment.DownloadFileGroup. But, as for me, this is not a perfect solution.

share|improve this answer
add comment

You may find my recent blog posting on MSBuild and Multiple environments useful. Consider that each of your clients could have its own 'environment', allowing you to specify their various configurations individually.

If you used this approach, you could still 'sign' the deployment.

Good luck!

share|improve this answer
add comment

Your Answer


