iis disable debug

August 27, 2015

In IIS to disable debug do the following.

Modify the Web.config File

  1. Open the Web.config file in a text editor such as Notepad.exe. Web.config file is typically located in the application directory.
  2. Modify the compilation element and set debug=”false”

    <compilation 
        debug="false"
    />
    
  3. Save the Web.config file. The ASP.NET application automatically restarts.

Modify the Machine.config file

  1. Open the Machine.config file in a text editor such as Notepad.exe. The Machine.config file is typically located in the following folder:

    %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\
    
  2. In the Machine.config file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to true.

  3. If the debug attribute is true, change the debug attribute to false.

    <deployment retail="true" />
    
  4. Save the Machine.config file.

  • Test if Debug is really off
  1. Use curl to test if debug is on or off

    curl -k -H "Command: stop-debug" -X DEBUG <some url>