15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

408 ❘ ChaPTer 17 deplOyment<br />

Deployment processes can be complex for a large application. Planning for the deployment can save time<br />

<strong>and</strong> effort when the deployment process is implemented.<br />

Choosing the proper deployment option must be done with the same care <strong>and</strong> planning as any other aspect<br />

of the system being developed. Choosing the wrong option will make the process of getting the software<br />

into the users’ h<strong>and</strong>s difficult <strong>and</strong> frustrating.<br />

deployment options<br />

This section provides an overview of the deployment options that are available to .<strong>NET</strong> developers. Most<br />

of these options are discussed in greater detail later in this chapter.<br />

➤<br />

➤<br />

➤<br />

➤<br />

Xcopy — The xcopy utility lets you copy an assembly or group of assemblies to an application folder,<br />

cutting down on your development time. Because assemblies are self-discovering (that is, the metadata<br />

that describes the assembly is included in the assembly), you do not need to register anything in<br />

the registry.<br />

Each assembly keeps track of what other assemblies it requires to execute. By default, the assembly<br />

looks in the current application folder for the dependencies. The process of moving (or probing)<br />

assemblies to other folders is discussed later in this chapter.<br />

Publishing web sites — When a web site is published, the entire site is compiled <strong>and</strong> then copied to a<br />

specified location. As a result of precompiling, all source code is removed from the final output <strong>and</strong> all<br />

compile errors can be found <strong>and</strong> dealt with.<br />

Deployment projects — Visual Studio 2010 has the capability to create setup programs for an<br />

application. There are four options based on Microsoft Windows Installer technology:<br />

➤<br />

➤<br />

➤<br />

➤<br />

Creating merge modules,<br />

Creating a setup for client applications,<br />

Creating a setup for web applications, <strong>and</strong><br />

Creating a setup for Smart Device-based (Compact Framework) applications.<br />

The ability to create cab files is also available. Deployment projects offer a great deal of flexibility<br />

<strong>and</strong> customization for the setup process. One of these deployment options will be useful for larger<br />

applications.<br />

ClickOnce technology — The ClickOnce technology offers a way to build self-updating<br />

Windows-based applications. ClickOnce allows an application to be published to a web site,<br />

file share, or even a CD. As updates <strong>and</strong> new builds are made to the application, they can be<br />

published to the same location or site by the development team. As the application is used by the<br />

end user, it checks the location to see if an update is available. If there is, an update is attempted.<br />

deployment requirements<br />

It is instructive to look at the runtime requirements of a .<strong>NET</strong>-based application. The CLR has certain<br />

requirements on the target platform before any managed application can execute.<br />

The first requirement that must be met is the operating system. Currently, the following operating systems<br />

can run .<strong>NET</strong>-based applications:<br />

➤<br />

➤<br />

➤<br />

Windows XP SP3<br />

Windows Vista SP1<br />

Windows 7<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!