Disabling Debugging

Disabling Debugging

Debug Mode

  • ASP.NET can be configured to run applications in a mode that facilitates developer troubleshooting
  • This debug mode causes ASP.NET to compile applications with debug symbols
  • Applications compiled in debug mode execute more slowly
  • Enable debug mode only when a developer is doing interactive troubleshooting
  • Debug mode is disabled by default
  • Disabling debug mode can significantly improve performance
  • Check to see if debug mode was left enabled after troubleshooting was completed
    • Both the machine.config and web.config file need to be checked because debug mode can be enabled in either
    • The <compilation> node and syntax for enabling/disabling debug mode is the same in both the web.config and machine.config files. It is less common to see debug mode enabled in the machine.config file

Dynamic Debug Compilation

  • Set compilation debug="true" to enable ASPX debugging
  • This inserts debugging symbols (.pdb information) into the compiled page
  • This creates a larger configuration file that executes more slowly
  • Only set this value to true when debugging
  • Set this value to false when not debugging to improve runtime performance of the application

Configuration Settings

<system.web>

    <compilation defaultLanguage="c#" debug="false">
          <assemblies>
            ...
          </assemblies>
    </compilation>

</system.web>


Sources