Deploying an Application
Now that the application works, how do you deploy it? The good news is that in .NET there is no Registry to fuss with; you could, in fact, just copy the assembly to a new machine.
For example, you can compile the program in Example 13-3 into an assembly named FileCopier.exe. You can then copy that file to a new machine and double-click it. Presto! It works. No muss, no fuss.
Deployment Projects
For larger commercial applications, this simple approach might not be enough, sweet as it is. Customers would like you to install the files in the appropriate directories, set up shortcuts, and so forth.
Visual Studio provides extensive help for deployment. The process is
to add a Setup
and
Deployment
project to your application project.
For example, assuming you are in the FileCopier
project, choose Add Project, New Project from the File menu and
choose Setup and Deployment Projects. You should see the dialog box
shown in Figure 13-10.
Figure 13-10. The New Project dialog box
You have a variety of choices here. For a Windows project such as this one, your choices include:
- Cab Project
Much like a Zip file, this compresses a number of small files into an easy-to-use (and easy-to-transport) package. This option can be combined with the others.
- Merge Module Project
If you have more than one project that use files in common, this option helps you make intermediate merge ...
Get Programming C#, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.