To enable debugging for a particular project, both the project properties and
web.configmust be updated. To update the project properties, right-click on the project in the Solution Explorer tab, and select Properties. Go to the Web tab, and select the ASP.NET checkbox in the Debuggers section, as shown in the following screenshot:
web.configfile, go to the
configuration/system.web/compilationelement. If the element does not exist, add a new node. To enable debugging, the
debugproperty of the
<compilation>node should be set to
true, as follows:
<compilation debug="true" … />
Debugging jQuery code in Visual Studio can be done by performing the following steps:
Press F5, or navigate to Debug | Start Debugging, to start running the application in the debug mode. The execution will stop at the first breakpoint that it comes across, as shown in the following screenshot:
Press Shift + F5 to stop debugging.
Make sure that you turn off debugging before launching the application in the production environment. An application that has debugging enabled has a slower performance since debugging generates additional information to enable the debugger to display the contents of variables. It also outputs more information to the call stack, which can become a security issue in the production environment.