Originally, ASP. NET can be pre-compiled.

Source: Internet
Author: User

It takes not long to get started with Microsoft. NET Framework, but to understand its basic concepts.

Using asp.net to develop a small program makes deployment a little troublesome. the space of 10 MB is full because I put it in the project. aspx. cs ,. aspx. designer. cs and other source code files are all mounted to the server ...! @ # $ % ^

Just wondering if the. NET Framework vigorously promoted by MS is not like this. There should be an optimization solution for project release and deployment ---

Pre-compiled using aspnet_compiler. The program tool has two versions, Framework2.0 and 4.0, which are located in WINDOWS \ Microsoft.. NET \ Framework \ version. The former applies to asp.net websites of Version 2.0 \ 3.0 \ 3.5, and the latter applies to asp.net of Version 4.0 and later.

Run aspnet_compiler.exe and type aspnet_compiler -? Obtain the description of each option.

Example:
The following two commands are equivalent and depend on the IIS metadatabase. The compiled application is deployed to c: \ MyTarget:

Aspnet_compiler-m/LM/W3SVC/1/Root/MyApp c: \ MyTarget
Aspnet_compiler-v/MyApp c: \ MyTarget

Run the following command to compile the application/MyApp locally. In this way, no compilation is required when an HTTP request is sent to it:

Aspnet_compiler-v/MyApp

The following command does not depend on the IIS metadatabase because it explicitly specifies the physical source directory of the application:

Aspnet_compiler-v/MyApp-p c: \ myapp c: \ MyTarget

--------------------

After compilation, all. aspx,. ascx, And. cs files in all source folders in the project will be compiled.

When deploying to the server, you only need to upload the bin folder + Web. config. You can deploy the file without the aspx file.

10 MB of program source code is compiled before 1 MB of dll-Really Simple!

Author: "The original ASP. NET can be pre-compiled"

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.