Craig Shoemaker

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

The Roll

Subscriptions

News

Check out the Podcast
Polymorphic Podcast - the show about object oriented development, architecture and best practices in .NET
Subscribe to the Blog
ASP.NET 2.0 AJAX
Beginning Ajax with ASP.NET

Post Categories



ASP.NET 2.0 Compilation and Deployment Quick Reference

ASP.NET changes the way you handle compilation and deployment from what you might be used to from working with ASP.NET 1.1. Rick Strahl wrote an excellent article that describes the nuances in great detail. Check out his article for the step-by-step process, but at a high level there are a few facts you should be aware of when you are ready to deploy your ASP.NET 2.0 applications.

You may choose to deploy your web application to the server using one of three general options:

Note: There are more than three options, but this is a quick reference, so you are just getting the basic differences.

Pre-compiled: Allow Updates to ASPX
When you choose to pre-compile your website you have the option to allow updates to your ASPX files. If you choose to allow these updates DLLs are created for the code behind files in your web project. These files are generated with a random name and the publish feature will update your ASPX files to point the Inherits attribute to the appropriate DLL (which houses your namespace and class for each page).

Pre-compiled: Restrict Updates to ASPX
If you choose to pre-compile and not allow updates to your ASPX pages, all of your code (including HTML) is compiled into the DLL and the physical ASPX is placed on the web server as a marker, holding no markup or code whatsoever.

Dynamic Compilation: Allow Updates to ASPX and CS/VB Files
For reasons detailed below, you may choose to simply copy ASPX and CS/VB code behind files up to the web server in the same manner as they exist on your development machine. When the first user to hit a page arrives, the web server will compile the code for that page and allow execution throughout the site. The performance penalty is negligible as the compilation is only for that single page and only for the first user to hit the page.

Which Option is Best?
As always the answer is dependent upon your circumstances.

  • Pre-compilation allowing updates garners a performance gain, but forces you to re-deploy all of your ASPX files to the server when a change is made to ANY codebehind in the website.

  • Pre-compilation restricting updates gives you an even further performance gain, but you will not be able to add non-server processed updates to a web page without having to recompile.

  • Dynamic compilation is the easiest to maintain, but results in slightly lower performance and a potential security risk of your source files living on the web server.

Hopefully this helps you as you begin working with ASP.NET 2.0 website. Like I said this is just a quick reference, be sure to do your homework for the details.

posted on Thursday, September 14, 2006 11:36 AM by drazz75





Powered by Dot Net Junkies, by Telligent Systems