The <deployment retail=”true” /> attribute

When deploying ASP.NET applications to a production environment, you will most likely want to set the compilation debug attribute in web.config to false, as having debug set to true has some downsides:

  • Compilation takes longer as batch optimizations are disabled
  • Scripts and images from WebResources.axd will not be cached on the client
  • Larger memory footprint
  • Code will execute slower because of enabled debug paths

To force debug = false in all ASP.NET applications on the server, you can change the retail switch in machine.config:



        <deployment retail="true"/>




This will also disable page output trace and force custom error pages.


Comments have been disabled for this content.