How to: Debug Web Applications

ASP.NET is the primary technology for developing Web applications in Visual Studio. The Visual Studio debugger provides powerful tools for debugging ASP.NET Web applications locally or on a remote server. This topic describes how to debug a ASP.NET project during development. For information about how to debug a ASP.NET Web application already deployed on a production server, see Debugging Deployed Web Applications.

To debug a ASP.NET application:

  • You must have required permissions. For more information, see ASP.NET Debugging: System Requirements.

  • ASP.NET debugging must be enabled in Project Properties.

  • The configuration file of your application (Web.config) must be set to debug mode. Debug mode causes ASP.NET to generate symbols for dynamically generated files and enables the debugger to attach to the ASP.NET application. Visual Studio sets this automatically when you start to debug, if you created your project from the Web projects template.

  • For more information, see How to: Enable Debugging for ASP.NET Applications.

To debug a Web application during development

  1. On the Debug menu, click Start to begin debugging the Web application.

    Visual Studio builds the Web application project, deploys the application if necessary, starts the ASP.NET Development Server if you are debugging locally, and attaches to the ASP.NET worker process.

  2. Use the Debugger to set and clear breakpoints, step, and perform other debugging operations, as you would for any application.

    For more information, see Debugger Roadmap.

  3. On the Debug menu, click Stop Debugging to end the debugging session, or, on the File menu in Internet Explorer, click Close.

See Also

Tasks

How to: Enable Debugging for ASP.NET Applications

Other Resources

Debugging Web Applications and Script

Debugging ASP.NET and AJAX Applications