Page 276 - DCAP312_WEB_TECHNOLOGIES_II
P. 276
Web Technologies-II
Notes Figure 14.6: Attach to Process
Now when we press Ctrl+F5 in the browser showing our web page to refresh the page the
breakpoint in the Page Load method should be hit and we can start debugging.
14.1.5 Disable Debugging for an ASP.NET Application
To enable debugging, modify either the Web.config file or the Machine.config file, as detailed
in the following steps.
Modify the Web.config File
To enable debugging, add the compilation element to the Web.config file of the application. The
Web.config file is located in the application directory. To do this, follow these steps:
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. In the Web.config file, locate the compilation element. Debugging is enabled when the
debug attribute in the compilation element is set to true.
3. Modify the debug attribute to false, and then save the Web.config file to disable debugging
for that application.
The following code sample shows the compilation element with debug set to false:
<compilation
debug= “false”
/ >
Save the Web.config file. The ASP.NET application automatically restarts.
Modify the Machine.config File
We can also enable debugging for all applications on a system by modifying the Machine.config
file. To confirm that debugging has not been enabled in the Machine.config file, follow these steps.
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\
270 LOVELY PROFESSIONAL UNIVERSITY