Sunday, 24 July 2011

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:
  1. Right click the project in your Solution Explorer.
  2. Select Add New Item...
  3. Choose a Web Form.
  4. Name it Default.aspx.
  5. Click Add.

I just signed up at Server Intellect and couldn't be more pleased with my Windows Server! Check it out and see for yourself.

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.

Enabling Debugging
Alternatively, we have a different way to load up our website with debugging enabled. To do this:

  1. From the top menu, click Debug.
  2. 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:


We migrated our web sites to Server Intellect over one weekend and the setup was so smooth that we were up and running right away. They assisted us with everything we needed to do for all of our applications. With Server Intellect's help, we were able to avoid any headaches!

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.

No comments:

Post a Comment