How to: Debug Web Applications
This article applies to Visual Studio 2015. If you're looking for Visual Studio 2017 documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2017. Download it here.
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 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
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.
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 Basics.
On the Debug menu, click Stop Debugging to end the debugging session, or, on the File menu in Internet Explorer, click Close.