Soup to Nuts Lab 1: A Tour of Visual Studio.Net - Exercise 4: Basic Debugging (Page 5 of 6 ) Scenario In this exercise, you will examine the different tools the Visual Studio .NET 2003 IDE has to offer. Tasks Detailed Steps Set a breakpoint.
In the code pane for the Customers.xx class, find the following line:
C# Value = "You typed " + Value;
Visual Basic .NET Value = "You typed " & Value
Left-click the above line to place the cursor there, right-click and choose Insert Breakpoint.
The line becomes highlighted red by default, indicating a breakpoint is set on the line.
Run the code.
Press F5 on the keyboard.
The Visual Studio IDE starts up and the Customers form displays.
In the Customer ID text box type 1234.
Click Get Customer.
The Hello Soup to Nuts message box displays.
Click OK.
The IDE enters Break mode, and the line on which the current breakpoint is hit is highlighted the default yellow. By default, the Autos, Locals, and Watch 1 windows are organized in the lower-left pane of the IDE in break mode and the Call-Stack, Breakpoints, Command Window and Output windows are displayed in the lower right. These are all powerful features of the .NET debugger and will be hugely helpful for you to debug your code.
Step through the code.
Click Debug and choose Step Over.
The current line advances, indicated by the yellow highlight moving down one line.
In the code pane, hover the mouse cursor over the word Value.
A tool tip pops up showing the concatenated Value="You Typed 1234" .
Click Debug and choose Step Into.
A message box displays the text "You typed 1234" .
Click OK.
The IDE re-enters Break mode, and the line on which the current breakpoint is hit is highlighted the default yellow.
Click Debug and choose Continue.
The IDE switches back to run mode and the Customers form comes to the foreground.
Stop the run.
In the IDE, click Debug and choose Stop Debugging.
 | Take Microsoft software for a test drive. With MSDN Virtual Labs, you get full access to all available Microsoft products through 90-minute modules, each with its own downloadable manual. Try this lab out now. |
Next: Exercise 5: Configuring the Visual Studio .NET IDE >>
More .NET Articles More By MSDN Virtual Labs |