SIGN UP MEMBER LOGIN:    
ARTICLE

Deploying Programs in C#

Posted by Mike Gold Articles | Articles C# March 08, 2001
Deploying projects in Visual Studio.NET is fairly straightfoward. Most of the process is automated for you through some convenient wizards so it doesn't require much effort.
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 add framework 2.0(exe file) while creating exe of project i mean i have to add exe of framework 2.0 when i 'm deploying my project . after deployment at a time of installesion first it wil ask u want to install framework 2.0 so tell me how i'l add this option.

Posted by Rahat pattalbab Mar 30, 2011

Microsoft seems to change the GUIs of common tasks all the time.

Posted by george jost Nov 11, 2010

I created one package -> setup and create file on desktop -> run ( error: don't connect with .mdb file on C:\Program file\NameProgram\a.mdb) Help me!!! Please!!!

Posted by Dong Thang Feb 01, 2008

After creating a distributable file and installing it, I used tha add/delete to delete it. I found that, in doing so, some of my other programs would no longer work. I'm guessing that the location of some dll was deleted from the Registry. How do I avoid this?

Posted by ronald simon Feb 27, 2007
Team Foundation Server Hosting
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
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Team Foundation Server Hosting
Become a Sponsor