ASP.NET Application Compilation

In ASP.NET, there are three compilation models, which are useful in different scenarios. The first one is called Classic precompilation, and is used when you work with an ASP.NET Web Application project type. With this method some parts of the page, such as the code-behind class files, referenced assemblies, etc. are precompiled, and other parts, such as the markup logic (.aspx files) are dynamically compiled at runtime. You can only use this type of compilation with the code-behind model.

The second method is called Dynamic compilation. With it, all of the pages, code files, resources, etc. are copied to the server as is, and ASP.NET compiles them to an executable when the first user requests a site. An obvious drawback of this model is that the first requests of the page take more time to fulfill, so users must wait more. A great advantage is that you can always update the files on the server, without the need of stopping and recompiling your application.

Our third method is Site precompilation. Site precompilation allows you to compile your whole site, even the .aspx files into binaries, which could be transferred to the server. There is no performance penalty, but the updates are considerably trickier.

Be aware of that, from the above three, the default model is Dynamic compilation.

Continue reading “ASP.NET Application Compilation”

Advertisements

Publishing Web Sites

There are two ways of publishing websites in ASP.NET with Visual Studio:

  • Using the Copy Web Site Tool from Visual Studio
  • Using the Publish Web Site Tool from Visual Studio

Copy Web Site Tool:

Consider using the Copy Web Site Tool when you cannot open the remote site as Remote IIS Site, and need more power over it than a simple FTP Web Site. It supports synchronization which makes sure that all files in both sides are up to date.

When using the Copy Web Site Tool, essentially you are working with two web sites at the same time. The source site, which is the site opened in Visual Studio, and the remote site, where you want to copy the content of the source site. With synchronization enabled, you can choose between the versions of the files you want to hold, or discard. It also enables multiple developers to work on the same site in the same time.

The DOS command line tool named XCOPY has the same advantages as the Copy Web Site Tool, and it doesn’t require Visual Studio to be installed on your computer.

Continue reading “Publishing Web Sites”