Chapter 1 -Deploying Standalone .NET Application
Chapter 1 - Deploying Standalone .NET Application
DB Visual ARCHITECT (DB-VA) can generate all .NET code for accessing database, you do not need to write any SQL to insert, query, update or delete the record, hence you can develop quality Standalone .NET Application much faster, better and cheaper. In this chapter we focus on deploying standalone .NET application. If you want to know how to develop a quality standalone .NET application, you can reference the Programmer's Guide for .NET -Chapter 1 Developing Standalone .NET Application.
In this chapter:
- Creating the Setup Project for Standalone .NET Application
- Installing the Application
Creating the Setup Project for Standalone .NET Application
After you have developed the standalone .NET application in Visual Studio .NET, you may wonder how to deploy the application to another computer. Visual Studio provides an excellent feature to create setup file (installer) so you can install the application on other machines easily. You can download the example of the Programmer's Guide for .NET -Chapter 4 Developing Standalone .NET Application and follow the steps below to create the setup file and install it.
- Open the Chapter 4 example in Visual Studio .NET.
- Change the Active Solution Configuration from Debug to Release.
Debug and Release are different configurations for building your project. As the name implies, you generally use the Debug mode for debugging your project and the Release mode for the final build for end user. The Debug mode does not optimize the binary it produces (as optimizations can greatly complicate debugging) and generates additional data to aid debugging. The Release mode enables optimizations and generates less extra debug data.
- From the main menu, select Build > Build Solution to compile the code.
- The Release folder is created in bin folder of the project path. It contains all the referenced libraries and executable file.
- Copy the configuration file (hibernate.cfg.xml) from DB-VA generated C# project to the Release folder. The configuration file contains the connect database information. The application will fail when execution if this file is missing.
- Right Click the Solution, select Add > New Project from menu.
- Select Setup and Deployment Project in Project Types, and the select Setup Wizard in Templates. Click OK to create the Setup and Deployment Project.
- The Setup Project Wizard is shown.
- Select Create a setup for a Windows application and then click Next >.
- Choose the Primary output from Standalone School System, this option will help you to add all the DLL or EXE file to the setup file. You must select a correct project for primary output in solution. After that, click Finish. You can also click Next> to follow the wizard to add readme file to the setup file.
- The Setup project is created.
- Open the File System (Setup) of the Setup project. Right click the Application Folder, select Add > File to add the hibernate.cfg.xml manually.
- Right click Primary output from Standalone School System and then select Create Shortcut to Primary output from Standalone School System.
- The shortcut is created on the Application Folder. You can change the properties of the shortcut.
For Name -School System
For Folder -User's Desktop
This shortcut will be created on the user's desktop when user installs this application.
- Right Click the School System Setup project and select Build to create the installer.
- The setup file is created in School Project Setup\Release folder.
Installing the Application
The setup file is created in School Project Setup\Release folder. Now, you can copy the School Project Setup.msi file to another machine and install it.
- Double click the School Project Setup.msi file to start install, and then click Next >.
- Select the path to install the application. By default, application install in the Program File. Click Next>.
- Confirm to install then the application will be installed on your selected path. Click Close to finish the installation.
The installer created shortcut of School System on the Desktop and installed the application on selected path. User can double-click this shortcut to execute the standalone .NET application.
|
|
| Visual Paradigm International Limited |
| Website: |
www.visual-paradigm.com |
| E-mail: |
support@visual-paradigm.com |
|