Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deploying dotNET applications 2

Status
Not open for further replies.

stephen2005

Programmer
Feb 13, 2005
53
IE
I'm just wondering what the various deployment options are for ASP.NET 2.0 projects are for both desktop and web applications. What are the pro's and con's of each etc.
 
You should probable do a google search on this as this topic would be 50 pages in a book.

Start with "Click Once", "MSBuild".

Here is some information on the different compilation models for .Net



Disadvantages of current 1.1 Compilation Model
1) The .aspx pages must be deployed to the web site in human-readable form. A possible security risk
2) The first time anyone requests a web page, the response will be slower than normal because the pages must be compiled
3) Pages became quite verbose in size, with all the required event wiring and control instantiation code visible
4) Compilation sometimes caused issues with the versions of the assembly used in your temporary ASP.net cache
5) Some bugs in your code were not picked up until the page ran through just in time compilation

There are 4 methods of compilation in 2.0 in order of flexibility
1) Most Flexible - Full runtime compilation: ASP.NET 2.0 also provides a new mechanism to compile the entire application at runtime. That is, you can put your uncompiled code-behind files and any other associated code in the new App_Code directory, and let ASP.NET 2.0 create and maintain references to the assembly that will be generated from these files at runtime. This option provides the greatest flexibility in terms of changing web site content at the cost of storing uncompiled code on the server. This similar to classic ASP.
Ex Create a web project and create a virtual directory pointing to that directory. Browse to your website. ASP.Net will build the application on the fly and you will see your web page. There will be a folder named for the virtual directory in Temporary ASP.NET Files with the compiled files

2) More Flexible - Normal (ASP.NET 1.x): In a ASP.NET 1.x web application, the code-behind files were compiled into an assembly and stored in the bin directory. The .aspx pages were compiled on demand. This model worked well for most web sites. However, the compilation process made the first request of any ASP.NET page slower than subsequent requests. ASP.NET 2.0 continues to support this model of compilation.
Ex Create a web project. Build the web project. The assemblies will be built and placed in Temporary ASP.NET Files in a folder named for your project. This is also where the assemblies are when debugging. This is really more of a validation step.

3) Very little flexibility – In-place precompilation: The ASP.NET 2.0 compilation model allows you to precompile all the code-behind files for your application and still make updates to your code. You can compile your code-behind and original .aspx files (both partial classes) into a single precompiled class (the page's base class). If you chose to edit your .aspx file at runtime, you must simply recompile your page.


4) Not Flexible at all – Deployment precompilation: A new feature of ASP.NET 2.0 allows for full compilation of your project prior to deployment. In the full compilation, all of the code-behind files, .aspx pages, HTML files, graphics resources, and other back-end code are compiled into one or more executable assemblies, depending on the size of the application and the compilation settings. The assemblies contain all the compiled code for the web site and the resource files and configuration files are copied without modification. This compilation method provides for the greatest performance and security, at the cost of removing all ability to modify the web site post-deployment. If you are working with highly visible or highly secure web sites, this option is the best choice for final deployment. However, if you are building a small site running on your local intranet, and the site changes frequently, full precompilation may be over-kill.


Methods 3 and 4 can be precompile either by running the command or by using the aspnet_compiler.exe, However the Precompile.axd option was removed from Beta2


More Information
Explanation about change from 1.1 compilation to 2.0.

Good over view of compilation methods

More info on the aspnet_compiler

Other Build Related information
MSBuild.exe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top