Precompile and Publish ASP.Net web apps

We’ve added some new functionality to the IDE in support for precompling and publishing a web app.  As you know by default, ASP.NET dynamically parses and compiles any ASPX page when the first request is made for the page. The .Net runtime caches the compilation outputs and does not need to recompile again unless someone edits a file. This behavior brings us a good amount of flexibility, including the flexibility to change code and markup. and instantly see the changes reflected in the next browser request.  ASP.NET 2.0 introduced the option of precompiling your website. Precompling offers the following advantages :

  • You do not need to deploy the source code to the server. The website is precompiled into binaries, which are then deployed to the server.
  • It allows you to identify any bugs during compilation rather then opening each page
  • The deployment process is a bit easier as all your aspx pages, user controls etc. are compiled into binaries.There are a few different ways you can precompile a website.
Precompiling websites at the command-line

When you have an ASP.Net project open the IDE command “Build” only validates the project and puts the assemblies into the ASP.NET temporary folder.

The values you enter on the new MSBuild tab of the Propect Properties are valid if you want to build the project from the command line. So at a command prompt you use this syntax:

MSBuild <projectfile>.aspxproj /target:Msbuild /property:ClaNetBinPath=<Clarion.Net BIN folder>

aspprocomp

Precompile and publish websites using the Clarion IDE

To precompile and publish your website using the IDE follow these steps:

1. Open your website project
2. In the Solution Explorer right-click on the Project and from the context menu choose “Publish Web Site”

asp1

3. You then get a Publish Web Site dialog like shown below where you can specify the path to publish. Clicking on the eplisis(…) lets you choose a folder.

asp2
4. Select your options in the dialog :

a. Allow this precompiled site to be updatable – This option allows you to change the markup and client side functionality of the .aspx pages.
b. Use Fixed Naming And Single Page Assemblies
c. Enable strong naming on precompiled assemblies – specifies that your assemblies are strong named using a key file or container.

5. Click Ok to compile and publish the website.

1 thought on “Precompile and Publish ASP.Net web apps

  1. Great feature guys!!! When the app generator for .NET will be available? Congrats from Argentina for the whole team and for the work that you’ve been going…. Keep going in this way

Comments are closed.