ASP.NET Web Site Debugging Part 1 Enabling Debugging
This tutorial is the first part of the ASP.NET Web Site Debugging tutorial series. This tutorial will demonstrate how to enable debugging with an ASP.NET 4.0 Web Site in Microsoft Visual Studio 2010.
When working with ASP.NET Web Sites, debugging is not enabled by default. However, with more complex projects you may want to debug your ASP.NET Web Site.
Creating a Web Site
The first thing we want to do here to demonstrate debugging is create a new ASP.NET Empty Web Site. Once created, we want to add a Web Form to it. To do this:
- Right click the project in your Solution Explorer.
- Select Add New Item..
- Choose a Web Form.
- Name it Default.aspx.
- Click Add.
Now that we have a Web Form, I want to demonstrate how to view this page without debugging. To do this, right click on Default.aspx in your Solution Explorer and select View in Browser. This will load up your website without debugging enabled.
Alternatively, we have a different way to load up our website with debugging enabled. To do this:
- From the top menu, click Debug.
- Select Start Debugging.
This will bring you a prompt that looks like this:
Selecting the top option and clicking OK, we will enable debugging in the Web.Config file which will now look like this:
Notice that under the compilation options debug is now set to true, however to run this web site with debugging you will always have to either choose the Start Debugging option or simply hit the shortcut F5. This will allow you to add in breakpoints and utilize a lot of other functionality that is only available while debugging, which we will discuss in later parts of this tutorial series.
Download Source Files