ASP.Net Compilation and Merge Tool (Part 1 of 2)

ASP.NET Compilation tool is used to compile an ASP.NET Web application either in same machine or to deploy on a target machine such as a production server. It helps application performance because end users do not encounter a delay on the first request to the application while the application is compiled on backend.

 

Compilation for deployment can be in one or two ways

  • That removes all files such as code-behind and markup files
  • That retains markup files.
 Syntax

aspnet_compiler  [-?]

                 [-m metabasePath | -v virtualPath [-p physicalPath]]

                 [[-u] [-f] [-d] [-fixednames] targetDir]

                 [-c]

                 [-errorstack]

                 [-nologo]

                 [[-keyfile file | -keycontainer container ] [-aptca] [-delaysign]]

 

Example

Aspnet_compiler -v /WebApp1 -p "c:\MyProjects\WebApp1" -keyfile "c:\MyProjects\KeyWebApp1.sn" -apt