SIGN UP MEMBER LOGIN:    
ARTICLE

Deploying Programs in C#

Posted by Mike Gold Articles | Deployment March 08, 2001
Deploying projects in Visual Studio.NET is fairly straightforward. Most of the process is automated for you through some convenient wizards so it doesn't require much effort. Keep in mind, though that you probably need the Windows Component Update Beta 1 on the machine you are deploying to. I suspect you also need the Microsoft .NET Framework, as well (for now).
Reader Level:

Deploying projects in Visual Studio.NET is fairly straightforward.  Most of the process is automated for you through some convenient wizards so it doesn't require much effort.  Keep in mind, though that you probably need the Windows Component Update Beta 1 on the machine you are deploying to. I suspect you also need the Microsoft .NET Framework, as well (for now).   Also note that Microsoft states that the current Deployment may not work in the future:

"Caution   Installers and merge modules created with the Beta release may not be 100 percent compatible with final Visual Studio.NET versions. While we want you to explore deployment and test the technology, we also want you to make sure that you don't distribute any installers or merge modules created with this release."-MSDN

Once your application is completed in Visual Studio, you can deploy it using the following steps:

First,  choose Add New Project from the File Menu:

Once you've done this, choose Setup and Deployment Projects.  Visual Studio then gives you a list of options for deploying your project, depending upon whether you are deploying to the web, in a compressed .cab file or as a windows setup program. 

Below is the different types of project setups, their description ,and their purpose:

Project Setup Description Purpose
CAB Project A Microsoft Compressed Cabinet file that can be opened using cabarc.exe Used for deploying applications for download from the web
Deploy Wizard Creates Deployment files for either the web or as a windows installation using a .msi setup file
and deploying them to a remote machine or your own machine
Used for creating setup files and deployment of the project all at once.
Merge Module Packages components that are shared by different applications Deploys a library of components
Web Setup Wizard Creates an installation for web-based applications.  The installation will install into the virtual root directory on a web server Uded for creating an Installation for a web server
Setup Wizard Creates setup files for  a windows installation using a .msi setup file Used for creating setup files.  Seems to create only the .msi file with everything compressed into this file. Running places the program in the program files directory.

We will choose the setup wizard to deploy this particular application.  The setup wizard brings up a nice step by step dialog for creating our setup project:

As stated in the dialog,  the wizard creates an installer that you can use to install your project.  The next screen asks you what kind of installer you wish to create:

We want a plain old Windows setup, so we choose setup for a rich client application.  The next screen prompts us as to which files we would like installed:

If you just want to deploy the application with no source or documentation, then just choose Primary output. This will deploy the necessary exes and dlls for your application.  

The next screen prompts you for additional files such as readme.txt, web pages, or anything else you'd like to include in the install that Microsoft didn't think of. In the case of Hangman, we added the sound files:

The last screen is just a report informing you of what you've done and where the vdp (visual deployment project) is created:

When you click finish, a directory is created for deployment.  Now we need to build our project  in order to deploy it, so simply choose build solution from the build menu.  This will create the MySetupProject.msi file needed to install the application.

If we double click on MySetupProject.msi after it is created, it will launch the installation.  For most installations, this just means xcopying all the necessary files into a directory under program files.  In the case of the hangman project, these would be all the System.xxx.dll's, the Microsoft.xxx.dll's (CLR Libraries), nlp files (common language resources), the runtime class library mscorlib.DLL, mngdist.dll(not sure what it does, but I guess it manages distribution), xxx.wav (sound files) and of course our own executable(In this case Hangman.exe.)

Login to add your contents and source code to this article
share this article :
post comment
 

How to get .exe file as my setup file in my .net application please reply

Posted by Surya prakash Mar 04, 2012

you should take 5 primary output then you can do what ever you want .

Posted by pradeep yadav May 22, 2010

hello Mike
By the way good job and answers.
can you help me with a certain problem.
i want to know which database (access, mssql, mysql) is easier and better for deployment.
Also, when installing my project from one PC to the other must i copy the database to the PC or can it just be done via the deployment.
Thanx

Posted by brian brian Jan 05, 2010

your article makes it very clear and very easy - thanks!

Posted by jenka13all Sep 09, 2009

hi, i have created 5 forms in my project. i deployed it but only last form is working. i want to create separate  modules as in Microsoft's office Word, Excel, Outlook for my 5 forms. please tell me how to do it?

Posted by Shrikant Kamble Jul 15, 2009
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Gauge for SharePoint
Become a Sponsor