Visual Studio – ClickOnce Deployment

ClickOnce is a feature of Visual Studio 2008 that allows a developer to quickly and fairly easily create a deployment package for their software.

ClickOnce Publish Wizard Dialogue
ClickOnce Publish Wizard Dialogue

The ClickOnce feature supports two types of applications – installed applications and online applications. The installed applications are similar to traditional Windows applications that appear in the start menu and can be removed with Add/Remove Programs. The online applications are hosted in the browser and not actually installed on the local machine.

As Wikipedia notes:

ClickOnce enables the user to install and run a Windows application by clicking a link in a web page. The core principle of ClickOnce is to bring the ease of deployment of web applications to the Windows user. In addition, ClickOnce aims to solve three other problems with conventional deployment models: the difficulty in updating a deployed application, the impact of an application to the user’s computer, and the need for administrator permissions to install applications.

ClickOnce applications can be deployed to a computer from a web site, a network share, and from traditional media like CD and DVD.

You may be wondering why I’m talking about such a seemingly trivial process… Well, in the past week, I’ve been working with ClickOnce, and while it is easy, and it does make deployment of an application really simple, it has a few quirks that are rather annoying.

It seems so simple!
It seems so simple!

When you’re creating an application you will often add additional files to the project, important files that are needed to ensure the application works properly. My recent project had a couple of PGP Key Rings that it absolutely had to have in order to operate.

Visual Studio assumes that the files you’ve added are only there to be viewed and that those files are not important to the running of your application. Therefore, those files are excluded, by default, when you create a deployment package with ClickOnce.

After a bit of trial and error, and a number of Google searches, I finally came across an excellent tutorial on including important files in the deployment package for ClickOnce. If you’re fighting with ClickOnce, like I was, please check out Neil Knobbe’s ClickOnce Deployment – Deploying files with your application.


Other awsome works, possibly related: