oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

The Magic of ClickOnce

by Wei-Meng Lee
Use ClickOnce to Deploy Windows Applications

Over the past few years, businesses have begun to favor deploying web applications instead of Windows applications. One of the major attractions of the web application is its ubiquitous access--anyone with a web browser can access the application, and there are no setup issues to worry about. However, network latencies and server delays are just some of the problems that are preventing developers from reaping the full benefits of the Web. Common frustrations over web applications include slow response time from web sites and limited functionality (due to the stateless nature of the HTTP protocol).

A smart client is basically a conventional Windows application that web services use to communicate with the server for back-end processing.

In this article, I will show you the support of smart clients in Visual Studio 2005 and how it makes deploying them easy and painless. Note that I won't be going into the security aspects of smart clients in this article, but the aim of this article is to give you an idea of the capability of ClickOnce, a new feature of Visual Studio 2005.

The Uses of Smart Clients

Let me share the experience of one of my customers. My customer manages a large group of agents, and each agent uses a web application provided by my customer. As the agent base grows, the response of the web server becomes a bottleneck. Moreover, the agents complain that the incessant postbacks that web applications usually perform are affecting the responsiveness of the application. Upon closer inspection, the problem lies in the complex logic embedded in the web application, and each web page contains tons of JavaScript code. All of these things add to the burden of the web server and make the application unresponsive.

Ultimately, a better solution to address the limitations of web applications is to deploy smart clients. Users would just need to download the application onto their machines once and then the application will run locally. When the application needs to access data from the server (or retrieve data from the server), web services are used.

Deploying Smart Clients

Visual Studio 2005 makes the deployment of smart clients extremely easy and painless, all through a new feature known as ClickOnce. To illustrate how ClickOnce works, I will create a new Windows application using Visual Studio 2005 and name it SmartClient. Populate the Windows form with the Calendar control, as shown in Figure 1.

Figure 1
Figure 1. Populating the Windows form with the Calendar control

Next, build the SmartClient Windows application by going to Build -> Build SmartClient. You can now publish (deploy) the application using IIS. Go to Build -> Publish SmartClient (see Figure 2) to start the Publish Wizard.

Figure 2
Figure 2. Publishing the SmartClient Windows application

You have a few options for where to publish the application--disk, shared folder, FTP server, or web server. For this article, I will show how to publish the application through the IIS web server.

Specify the location to publish the application (see Figure 3). Click Next >.

Figure 3
Figure 3. Specifying the path to publish the folder

Pages: 1, 2, 3

Next Pagearrow