ASP.Net Flexible Deployment

Because ASP.NET compiles your Web site on first user request, you can simply copy your application's source code to the production Web server. However, ASP.NET also provides precompilation options that allow you to compile your Web site before it has been deployed, or to compile it after it has been deployed but before a user requests it. Precompilation has several advantages. It can improve the performance of your Web site on first request because there will be no lag time while ASP.NET compiles the site. Precompiling can also help you find errors that might otherwise be found only when a user requests a page. Finally, if you precompile the Web site before you deploy it, you can deploy the assemblies instead of the source code.

You can precompile a Web site using the ASP.NET compiler tool (ASPNET_Compiler.exe). The tool that provides the following precompilation options:
  • In-place compilation This option performs the same compilation that occurs during dynamic compilation. Use this option to compile a Web site that has already been deployed to a production server.
  • Non-updateable full precompilation Use this to compile an application and then copy the compiled output to the production server. All application code, markup, and UI code is compiled into assemblies. Placeholder files such as .aspx pages still exist so that you can perform file-specific tasks such as configure permissions, but the files contain no updateable code. In order to update any page or any code you must precompile the Web site again and deploy it again.
  • Updateable precompilation This is similar to non-updateable full precompilation, except that UI elements such as .aspx pages and .ascx controls retain all their markup, UI code, and inline code, if any. You can update code in the file after it has been deployed; ASP.NET will detect changes to the file and recompile it. Note that code in a code-behind file (.vb or .cs file) built into assemblies during precompilation, and you therefore cannot change it without going through the precompilation and deployment steps again.
Tags: ,
Hot on Web:


About author