简体   繁体   中英

Side effects when not using the -u option of aspnet_compiler.exe

Following is the MSDN instruction, but not sure what it means:

-u

Specifies that Aspnet_compiler.exe should create a precompiled application that allows subsequent updates of contents such as .aspx pages. If this option is omitted, the resulting application contains only compiled files and cannot be updated on the deployment server. You can update the application only by changing the source markup files and recompiling. The targetDir parameter must be included.

Can anyone explain it for me.

If you specify -u the markup of your pages and controls (aspx/ascx) will be left intact and will be compiled just-in-time (eg when first accessed). This allows you to edit the markup directly on the deployment server (without having to rebuild/publish the solution).

If you don't specify -u , then the markup is compiled and the pages/controls are replaced with empty place-holder files. If you need to make a change to the markup, you have to do it on your development server, then rebuild/publish the solution.

This page explains all the options of aspnet_compiler.exe.


BTW: this part of the documentation may be important for deciding whether to use -u or not:

When you use [the -u option], code blocks in .aspx files (that is, code located in script elements or between <% and %> tags) are not compiled. Therefore, in those code blocks, , because the .aspx file is fully compiled only then. 这些代码块中 ,因为.aspx文件才被完全编译。 It is generally unsafe to use this option for a site that relies on code blocks in .aspx files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM