|
Microsoft with its .NET Framework brings in some novel, flexible and easy way to deploy the developed Windows and Web applications. The .NET Framework offers many characteristics that make it easier to deploy the applications. These features are as follows:
- No-touch deployment: .NET Framework gets rid of DLL conflicts. Installing or removing of components does not affect other applications. Thus it provides a solution to “DLL Hell” problem. No-impact applications, which offers application isolation and purge DLL conflicts.
- Controlled code sharing: Sharing is explicit rather than the default.
- XCOPY deployment and reproduction: XCOPY deployment is appropriate to be used in certain specific simple deployment scenarios. With Self-described and self-contained components and applications there is no need for registry entries or dependencies. This facilitates to install desktop applications on client machines using a remote web server.
- Integration with the Windows Installer: Advertisement, publishing, repair, and install-on-demand are all on hand when deploying the application. In Visual Studio.NET the deployment tools are built on the groundwork of Windows Installer, which offers rich capabilities for swift deploying and easy maintenance of applications.
- Private components by default: By default the components are deployed to the application directory.
- Side-by-side versioning: We can run one version of the application side-by-side (The CLR can manage multiple versions of a software component to be run concurrently) with another version. We can also decide which versions to employ, and versioning policy is enforced by the common language runtime.
In Visual Studio.NET if you compile a project, the code-behind class file (.aspx.vb, or .aspx.cs) is compiled into a .dll file along with all other class files which are incorporated with the project. If a request is made for that ASP.NET page, then the .dll file is instantiated and executed. You can modify the visual elements of Web form pages without recompiling and redeploying. But you can't change the code without recompiling. Usually the .dll file is stored in the web application's bin directory.
There are methods for deploying ASP.NET applications.
- XCopy deployment.
- Setup Wizard
XCopy Deployment:
The easiest method to copy a project or application from one location to another is to employing XCopy. XCopy deployment is a trouble-free technique to install simple .NET applications. Usually this method is not employed in the Windows due to the convolution and COM/COM+ Component registrations. In the past, for registering the components we have to employ Regsvr32.exe utility etc.
Typically for deploying an application we copy the application or component into the virtual directory of the Web server. With self-describing assemblies and versioning to the .NET Framework, there are no more registry entries, which facilitate to make use of XCOPY for deployment.
In ASP.NET, XCopy deployment refers to copy required files from one location to another location (Virtual directory on the Web server) by employing the drag-and-drop feature in Microsoft Windows Explorer, File Transfer Protocol (FTP), or the DOS XCopy command.
XCOPY deployment is accomplished from the command prompt. You use the XCOPY command to specify the source directory and the target directory. The /s flag indicates that subdirectories are to be copied as well. For example, the following command-line command is used to copy the MyApplication directory and all subdirectories from drive D to drive C:
XCOPY D:\MyApplication C:\MyApplication /s
To deploy your application using XCOPY
• Verify that your application meets the requirements for XCOPY deployment.
• Open the command window. To locate the command window in Microsoft Windows XP, click Start, All Programs, Accessories.
• Run XCOPY from the command prompt, specifying the source and destination directories and including any command-line flags, such as the /s example cited previously .
SetUp Wizard
VS .NET installer provides you with the functionality where you can distribute your Web application as a collection of build outputs, installer classes, and database creation scripts; it is often easier to deploy complex solutions with Windows Installer files. VS .NET provides Web setup projects that can be used to deploy Web applications. These Web setup projects differ from standard setup projects in that they install Web applications to a virtual root folder on a Web server rather than in the Program Files folder, as is the case with the applications installed using standard setup projects.
The Windows Installer divides applications into the following three levels.
- Product:- It is something a user can install. For example, MS Word is a product that a user can install.
- Feature:- A product is composed of multiple features. A feature is also the smallest unit of functionality of a product. For example, AutoCorrect functionality can be considered a feature of MS Word.
- Component:- A component can be considered the smallest unit that can be shared across multiple features and components. It is very important to understand that the component in Windows Installer terms is not the same as the term component in the .NET Framework. A Windows installer component can be a single file or multiple files that logically belong together. It can be an executable, a dll, or a simple text file. A collection of components can form together to provide a feature and it is also possible for a component to be shared across multiple features. While features are specific to a product and identified by a name unique only within the product, components are global across all products installed on a machine. For example, the spell checker component of MS Word can be shared across all the applications that want to implement spell-checking feature.
Creating a Web Setup Project Using VS .NET Installer
Step1: First Go to File>Add Project>New Project from the main menu. In the New Project dialog box, select setup and deployment projects from the Project type's pane and then select Web Setup project in the template pane.
Step2: After creating the project, you then need to add the output of the primary assembly and the content files of the ASP.NET Web application to the setup project. Right click on the particular project and then in the solution explorer and select Add->Project Output from the context menu. In the Add Project Output Group dialog box, select the “application” from the Project combo box and select Primary Output from the list.
Step3: After adding the project output, you then need to add the related Content Files (such as .aspx files, Images, and so on) to the project. To do this, again bring up the Add Project Output dialog box and then select Content Files from the list this time.
Step4: Configuring Properties through the Properties Window: There are a number of properties that you can set through the properties window of the Web Setup project. These properties determine the runtime display and behavior of the Windows installer file. The properties window provides properties such as Author, Description, Manufacturer, Support Phone and so on that can be very useful to the users (who are installing your application) of your application to get more details about your application.
Note:- Once we through with this, the .msi file are there where we can use it to install the Asp.Net Web Application.
|