In IIS to disable debug do the following.
Modify the Web.config File
- Open the Web.config file in a text editor such as Notepad.exe. Web.config file is typically located in the application directory.
-
Modify the compilation element and set debug=”false”
<compilation debug="false" />
-
Save the Web.config file. The ASP.NET application automatically restarts.
Modify the Machine.config file
-
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\
-
In the Machine.config file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to true.
-
If the debug attribute is true, change the debug attribute to false.
<deployment retail="true" />
-
Save the Machine.config file.
- Test if Debug is really off
-
Use curl to test if debug is on or off
curl -k -H "Command: stop-debug" -X DEBUG <some url>