Exforsys

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor

Ads


Home arrow Technical Training arrow VB.NET 2005

Web Application Tracing and Debugging Page - 3

Page 3 of 3
Author : Exforsys Inc.     Published on: 30th Jul 2005    |   Last Updated on: 24th Dec 2007

Web Application Tracing and Debugging


.
.
.

Ads

Debugging

Setting breakpoints and conditional breakpoints

While we have a facility to step through the program, it is not an easy task to do so. Setting a breakpoint at strategic location in the code is useful as the program runs normally till that point is reached. The program can be checked at execution time at the breakpoint. Then the user can press F5 to continue or step through the code by pressing F10 or F11. To insert a break point the user has to place the cursor on the line of the code where he wants to break the execution and press F9. Alternatively the user can also click on the margin to the left of you code. A breakpoint symbol is displayed on that line.

A breakpoint can be removed by placing the cursor on the line with break point and press F9 again or click on the breakpoint symbol to clear that break point. The context menu can also be used for this purpose.

If several break points have been set, the user can choose to remove all the break points by clearing all breakpoints by choosing the Clear All Breakpoints in the Debug menu. All breakpoints can be enabled or disabled by choosing the appropriate option. Breakpoints can also be created by choosing the new breakpoint option from the debug menu. A dialog box is presented with a dialog box like the screenshot shown below.

If the execution is to be broken based on the value of a variable, then a conditional Breakpoint can be added. Right-clicking on the breakpoint opens a condition dialog box. See screenshot below.

The Condition is an expression that determines whether the breakpoint is hit or skipped. When the debugger reaches the breakpoint, it will evaluate the condition. The breakpoint will be hit only if the condition is satisfied. You can use a condition with a location breakpoint to stop at a specified location only when a certain condition is true. If the application that is being debugged is a banking application, where the account balance is never allowed to go below zero, then it must be ensured that the value for the variable account balance is always greater than zero. The breakpoints may be set at certain locations in the code and condition attached like balance < 0 to each one. When the program is run, execution will break at those points only when the balance is less than zero. The variables and program state can be examined at the first breakpoint location, then continue execution to the second breakpoint location, and so on.

Debugging a running process

A running process can be debugged by first attaching to. Choose the option Attach to Process from the Debug menu to attach a process. In case no project is open, a process can be attached by choosing Attach to Process from the Tools menu. This action opens the Attach to Process dialog box to open. In the dialog box choose the program that has to be attached from the available processes list. After choosing this process then click on the attach button.

The list of available processes is displayed automatically when the processes dialog box is opened. Process can start and stop in the background while the dialog box is open. Because of this the contents may not be current and the user will have to be refresh the list from time to time, by clicking the refresh button.

It is also possible for the user to be attached to multiple programs simultaneously when debugging, but only one program is active in the debugger at any given time. The active program can be set in the debug location toolbar. All the debug commands affect the current program only.

The debug windows option can be clicked in Debug menu to select the processes window. In this processes window double click the process that has to be made active.

Debugging a remote process

A remote process can be attached in the same way as a user can attach to a local process. In order to attach a remote process, go to the Attach to Process dialog box as in the earlier case. Check on the transport check box to ensure that proper transport is selected. In the name box type the name of the remote machine or select the machine name from the drop down list. Click on the ellipse button next to the name list to open the Browse for Computer. In the browse for computer dialog box, use the name of the list to open the machine. Click OK to connect to the process in the remote machine.

In this lesson we have dealt in some detail the procedure involved in testing and debugging applications. In the next lesson we shall be examining how to work with legacy code.



 
This tutorial is part of a VB.NET 2005 tutorial series. Read it from the beginning and learn yourself.

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor
 

Comments