iis disable debug

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>
    

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.