Three major technologies for deploying ASP.net (i) (2)

Source: Internet
Author: User
Tags copy file system functions
ASP.net v. Deploy with the Vs.net "Copy Project" feature

Vs. NET's "Copy Project" feature enables us to deploy ASP.net Web applications to the target server very easily. This feature can either replicate Web projects to the same server or replicate to different servers.

If you are using vs.net to develop a Web application, the first thing to do before publishing a Web application is to change the "active solution Configuration" from debug to release, as shown in figure three, which not only makes the compiler optimize the code, but also deletes all the symbolic information associated with debugging. Make your code run faster. To open the Configuration Manager, select the Web Application project in Solution Explorer, select the menu item → XXXX project properties, where xxxx is the project name, and then tap Configuration Manager. In Active solution configuration, select release.



Figure Three

To copy the Web project to the target server, select Menu "item" → "Copy item ..." In Vs.net, VS. NET shows the dialog box for figure Four.



Figure Four

The Copy Project dialog box provides the following options:

㈠ Target project folder: Used to specify the target location for the replication project. The target location can be on the same server or on a remote server.

㈡web Access Method: The method used to copy a Web project to the destination folder is available in two ways for the selected Web access method. The first is file sharing, where you can access the file system directly on the Web server through file sharing, without requiring the FrontPage Server Extensions installed on the Web server, followed by "FrontPage", That is, the Web project's files are transferred to the server through a FrontPage Server extension based on the HTTP protocol, which requires that the FrontPage Server Extensions be installed on the Web server, which automatically creates the necessary virtual directories on the target server.

㈢ replication: Contains three options: ① is limited to files required to run the application, that is, only files that are output from the build feature (DLLs in the Bin folder and references) and content files (for example,. aspx and. asmx files), in most cases, we can deploy the application with this default option; ② all project files, that is, files that copy the output of the build feature (DLLs and references in the Bin folder) and all files in the project. Includes the project file and source program files, ③ all the files in the source project folder, that is, all project files and any other files in the project folder (or subfolder).

According to the actual situation select the Figure Four dialog box options, click "OK", you can deploy the Web project to the server.

Vi. deployment with Web installation projects

xcopy deployment and Vs.net's "replication capabilities" are easy to use, but not all of the deployment needs. For example, if your application has more complex configuration and deployment requirements, VS. NET's "Web Setup Project" is the best choice.

Although we can publish Web applications with a large stack of build outputs, installation classes, and database creation scripts, it is often easier to use Windows Installer for complex Web application projects. To support Web application deployments, VS. NET provides a "Web Setup Project". A Web Setup project differs from a normal setup project in that a Web installation project installs a Web application to a virtual root folder on a Web server, while an ordinary installation project typically installs the application to the Program Files directory.

Because Vs.net Setup is based on Windows Installer, you can take advantage of Windows Installer. Before we begin to explore the Vs.net Web Setup project, let's take a look at the main features of Windows Installer because it is the core of the Vs.net Web Setup project.

6.1 Windows Installer

Windows Installer is a software installation and Configuration service, Windows 2000 and Windows XP operating systems are all equipped with Windows Installer, and Microsoft offers a similar free version for all win 9x and NT 4 platforms. In Win2k/xp, the core of Windows Installer is a Windows Installer service that logs every application it installs, and when we delete an application, Windows Installer checks the installation records to ensure that other applications do not depend on these components before removing the applied components.

Windows installer divides applications into the following three levels:

⑴ Product: A unit that a user can install. For example, MS Word is a product that a user can install.

⑵ function: The product is composed of a variety of functions, the function is the smallest unit of product use. For example, AutoCorrect is a feature of word.

⑶ component: A component can be viewed as the smallest unit that can be shared between multiple functions and components. It is important to note that the components in Windows installer terminology are different from the concepts of components in the. NET Framework. A Windows Installer component is one or more logically related files, which can be an execution file, a DLL file, or a simple text file. A feature can be provided by combining multiple components, and a component can also be shared by multiple features. Functionality is always for a particular product, and the name of the feature is unique within a specific product range; In contrast, the component is global in scope and is scoped to all products installed on a single machine. For example, Word's spelling checker can be shared among all components that want to implement the spell-checking feature.

Product-related information, including features, description of components, etc., is centrally saved in an installation database. The installation database is actually just a file with an. msi extension that contains not only the functionality of the product, information about the components, but also the order in which the user interfaces are displayed during the installation of the product. Because Windows Installer is registered as a service program for the. msi file, Windows Installer is automatically invoked by the operating system when the user opens the. msi file. When you start Windows Installer this way, installer reads product information from the installation database to determine if the product is installed. If it is not already installed, installer starts the installation operation as described in the installation database and, if the product is already installed, may perform additional processing, such as adding/removing a feature, or uninstalling the entire product.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.