Skip to content

Commit 7dd865d

Browse files
authored
Merge pull request #8472 from paulcociuba/patch-3
AB#4649: Docs 2024 Review - Update disable-debugging-application.md
2 parents eef4cfc + 64b3ec4 commit 7dd865d

6 files changed

Lines changed: 51 additions & 20 deletions

File tree

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
title: Disable debugging for ASP.NET application
2+
title: Disable Debugging for ASP.NET Application
33
description: This article discusses how to disable debugging for ASP.NET applications.
4-
ms.date: 03/27/2020
4+
ms.date: 03/26/2025
55
ms.custom: sap:General Development
66
ms.topic: how-to
7+
ms.reviewer: paulboc
78
---
89
# Disable debugging for ASP.NET applications
910

10-
This article discusses how to disable debugging for ASP.NET applications.
11+
This article discusses how to disable debugging for ASP.NET applications running on .NET Framework.
1112

1213
_Original product version:_   ASP.NET
1314
_Original KB number:_   815157
@@ -18,38 +19,68 @@ ASP.NET supports compiling applications in a special debug mode that helps devel
1819

1920
Debugging is disabled by default. Debugging is frequently enabled to troubleshoot a problem. But it's frequently not disabled after the problem is resolved. This article describes how to disable debugging for an ASP.NET application.
2021

21-
To disable debugging, modify the *Web.config* file or the *Machine.config* file, as detailed in the following sections.
22+
To disable debugging, modify the **Web.config** file or the **Machine.config** file, as detailed in the following sections.
2223

2324
## Method 1: Modify the Web.config file
2425

25-
To disable debugging, add the compilation element to the *Web.config* file of the application by following these steps. The *Web.config* file is located in the application directory.
26+
To disable debugging, add the compilation element to the **Web.config** file of the application by following these steps. The **Web.config** file is located in the application directory.
2627

27-
1. Open the *Web.config* file in a text editor, such as Notepad. The file is typically located in the application directory.
28-
2. In the *Web.config* file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to **true**.
29-
3. Change the debug attribute to **false** to disable debugging for that application.
28+
1. Open the **Web.config** file in a text editor, such as Notepad. The file is typically located in the application directory.
29+
2. In the **Web.config** file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to `true`.
30+
3. Change the debug attribute to `false` to disable debugging for that application.
3031

31-
The following code sample shows the compilation element with debug set to **false**:
32+
The following code sample shows the compilation element with debug set to `false`:
3233

3334
```xml
3435
<compilation debug="false"/>
3536
```
3637

37-
4. Save the *Web.config* file. The ASP.NET application automatically restarts.
38+
4. Save the **Web.config** file. The ASP.NET application automatically restarts.
3839

3940
## Method 2: Modify the Machine.config file
4041

41-
You can also disable debugging for all applications on a system by modifying the *Machine.config* file. To confirm debugging hasn't been enabled in the *Machine.config* file, follow these steps:
42+
You can also disable debugging for all applications on a system by modifying the **Machine.config** file. To confirm that debugging isn't enabled in the **Machine.config** file, follow these steps:
4243

43-
1. Open the *Machine.config* file in a text editor, such as Notepad. The file is typically located in the following folder:
44+
1. Open the **Machine.config** file in a text editor, such as Notepad. The file is typically located in the following folder:
4445

45-
`%SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\`
46-
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**.
47-
3. If the debug attribute is **true**, change the debug attribute to **false**.
46+
`%SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\`
4847

49-
The following code sample shows the compilation element with debug set to **false**:
48+
For 64-bit versions of the .NET Framework, the file is in the following folder:
5049

51-
```xml
52-
<compilation debug="false"/>
53-
```
50+
`%SystemRoot%\Microsoft.NET\Framework64\%VersionNumber%\CONFIG\`
51+
52+
1. In the **Machine.config** file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to `true`.
53+
1. If the debug attribute is `true`, change the debug attribute to `false`.
54+
55+
The following code sample shows the compilation element with debug set to `false`:
56+
57+
```xml
58+
<compilation debug="false"/>
59+
```
60+
61+
1. Save the **Machine.config** file.
62+
63+
## Method 3: Using IIS Manager (if the web application is hosted on IIS)
64+
65+
1. Open IIS Manager on the computer where the website is hosted (you can select <kbd>Windows</kbd> + <kbd>R</kbd> and type **inetmgr**):
66+
67+
:::image type="content" source="media/disable-debugging-application/type-inetmgr-run-window.png" alt-text="Screenshot of typing inetmgr in the Run window.":::
68+
69+
1. Select the website or web application for which you want to enable or disable debug mode from the left-hand side tree view:
70+
71+
:::image type="content" source="media/disable-debugging-application/enable-disable-debug-mode-web-application.png" alt-text="Screenshot of website or web application for which you want to enable or disable debug mode." lightbox="media/disable-debugging-application/enable-disable-debug-mode-web-application.png":::
72+
73+
1. From the middle pane of IIS Manager, select the **.NET Compilation** icon:
74+
75+
:::image type="content" source="media/disable-debugging-application/net-compilation-icon.png" alt-text="Screenshot of the .NET Compilation icon." lightbox="media/disable-debugging-application/net-compilation-icon.png":::
76+
77+
1. Within the list of parameter values displayed in the middle pane of IIS Manager, set the value of **Debug** under the **Behavior** category to:
78+
79+
- **True**: Enable debug mode.
80+
- **False**: Disable debug mode.
81+
82+
:::image type="content" source="media/disable-debugging-application/set-value-debug-under-behavior-category.png" alt-text="Screenshot of setting the value of Debug under the Behavior category." lightbox="media/disable-debugging-application/set-value-debug-under-behavior-category.png":::
83+
84+
1. Select the **Apply** button from the right-hand side pane of IIS Manager to save the changes to the IIS configuration:
5485

55-
4. Save the *Machine.config* file.
86+
:::image type="content" source="media/disable-debugging-application/apply-button-iis-manager.png" alt-text="Screenshot of the Apply button in IIS Manager." lightbox="media/disable-debugging-application/apply-button-iis-manager.png":::
77.6 KB
Loading
117 KB
Loading
118 KB
Loading
64.2 KB
Loading
10.8 KB
Loading

0 commit comments

Comments
 (0)