Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼


Quick Apps With ClickOnce

Marcin Kawalerowicz runs a consultancy in Silesia, Poland. Craig Berntson has been Microsoft MVP since 1996. They are the authors of Continuous Integration with .NET.

ClickOnce is a Microsoft technology that lets you deploy a Windows Form or Windows Presentation Foundation (WPF) application via a Web page. With ClickOnce, users get to decide whether to install an application upgrade.

With ClickOnce, a "smart client" application is installed in a sandbox on the client machine with fewer rights than it would otherwise get. For example, it has no access to local files, and it's installed in a user's private folder, not in the Program Files.

For example, to make the Windows Calculator available via ClickOnce, go to the CiDotNet.WinCalc project properties and switch to the Publish tab (Figure 1). You'll need a Web server like Microsoft's Internet Information Service (IIS) to host your published apps.

[Click image to view at full size]
Figure 1: The Publish properties for windows application. The install is deployed to a share in the local network that is available over http.

Figure 1 shows a publishing target laying somewhere in the local network. In our test setup, IIS is installed on the ci1 server, sees the WinCalc folder, and is able to immediately host the WinCalc application. If you have Front Page Extensions installed on the remote IIS server you will be able to publish onto it right away.

To make the published version look nice you should define the deployment web page. Click on the Options… button. Fill in the Description then select Deployment from the listbox (Figure 2).

[Click image to view at full size]
Figure 2: Defining the deployment web page for the ClickOnce deployment.

It's time for a test publication. Press the Publish Now button or use the publishing wizard. Then, launch Internet Explorer and open the remote location. Be advised that Firefox and other browsers do not support ClickOnce without special plugins.

[Click image to view at full size]
Figure 3: A published ClickOnce application on a web page.

Now, if you click Install, WinCalc will be installed on your computer. The whole process works like a charm from Visual Studio. With a command line (and eventually Continuous IntegrationI), it is not so easy, as you will see next.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.