ASP.NET
  Home arrow ASP.NET arrow Page 2 - More on Testing and Debugging an ASP.NET 2...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

More on Testing and Debugging an ASP.NET 2.0 Application
By: Murach Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2006-05-18

    Table of Contents:
  • More on Testing and Debugging an ASP.NET 2.0 Application
  • How to use the debugger
  • How to use tracepoints
  • How to control the execution of an application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    More on Testing and Debugging an ASP.NET 2.0 Application - How to use the debugger


    (Page 2 of 4 )


     
    The topics that follow introduce you to the basic techniques for using the Visual Studio debugger to debug an ASP.NET application. Note that these techniques are almost identical to the techniques you use to debug a Windows application. If you’ve debugged Windows applications, then, you shouldn’t have any trouble debugging web applications.

    How to use breakpoints

    Figure 4-9 shows how to use breakpoints in an ASP.NET application. Note that you can set a breakpoint before you run an application or as an application is executing. Remember, though, that an application ends after it generates a page. So if you switch from the browser to Visual Studio to set a breakpoint, the breakpoint won’t be taken until the next time the page is executed. If you want a breakpoint to be taken the first time a page is executed, then, you’ll need to set the breakpoint before you run the application.

    After you set a breakpoint and run the application, the application enters break mode before it executes the statement that contains the breakpoint. In this illustration, for example, the application will enter break mode before it executes the statement that caused the exception in figure 4-8 to occur. Then, you can use the debugging features described in the topics that follow to debug the application.

    In some cases, you may want to set more than one breakpoint. You can do that either before you begin the execution of the application or while the application is in break mode. Then, when you run the application, it will stop at the first breakpoint. And when you continue execution, the application will execute up to the next breakpoint.

    Once you set a breakpoint, it remains active until you remove it. In fact, it remains active even after you close the project. If you want to remove a breakpoint, you can use one of the techniques presented in this figure.

    You can also work with breakpoints from the Breakpoints window. To disable a breakpoint, for example, you can remove the check mark in front of the breakpoint. Then, the breakpoint isn’t taken until you enable it again. You can also move to a breakpoint in the Code Editor window by selecting the breakpoint in the Breakpoints window and then clicking on the Go To Source Code button at the top of this window, or by right-clicking the breakpoint in the Breakpoints window and choosing Go To Source Code from the shortcut menu.

    The Order page with a breakpoint


    Figure 4-9.  How to use breakpoints

    How to set and clear breakpoints

    1. To set a breakpoint, click in the margin indicator bar to the left of the statement where you want the break to occur. The statement will be highlighted and a breakpoint indicator (a large dot) will appear in the margin. You can set a breakpoint before you run an application or while you’re debugging the application.
    2. To remove a breakpoint, click the breakpoint indicator. To remove all breakpoints at once, use the Debug->Clear All Breakpoints command.
    3. To temporarily disable breakpoints, use the Debug->Disable All Breakpoints command. You can later enable the breakpoints by using Debug->Enable All Breakpoints.

    Description

    1. When ASP.NET encounters a breakpoint, it enters break mode before it executes the statement on which the breakpoint is set. From break mode, you can use the debugger to determine the cause of an error.
    2. The current breakpoints are listed in the Breakpoints window (Debug->Windows-> Breakpoints). You can use the toolbar at the top of this window to work with the breakpoints, and you can use the check box next to a breakpoint to enable or disable the breakpoint.
    3. You can’t set breakpoints on blank lines or comments.

    More ASP.NET Articles
    More By Murach Publishing


       · This article is an excerpt from the book "Murach's ASP.NET 2.0 Web Programming with...
     

    Buy this book now. This article is excerpted from chapter four of the book Murach's ASP.NET 2.0 Web Programming with VB 2005, written by Joel Murach and Anne Boehm (Murach, 2006; ISBN: 1890774324). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - Developing a Mini ASP.NET AJAX Server Centri...
    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT