Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,265 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,210 people online right now. Registration is fast and FREE... Join Now!




Debugging Technique

 
Reply to this topicStart new topic

Debugging Technique, How to use "locals" and "watch" windows to show va

Junije
18 Aug, 2008 - 01:47 PM
Post #1

New D.I.C Head
*

Joined: 8 Jul, 2008
Posts: 13

Hi,

This is more of a C# IDE question then a programming related one.
I'd like to use the "locals" and "watch" window to show variables I want to keep an eye on, but never learned how to use it properly.
I've never used any of the debugging possibilities in the Microsofts' C# IDE, but I usually improvised by creating a separate form which showed the variables I needed to monitor, but since this is not the right way, nor professional way to debug, I'd like to leave that practice.

I haven't found much info about debugging in C#, and what I have found is poorly explained for a beginner to understand.

I've tried typing a variable name into a watch window in the "name" row, while in break mode in the IDE, but no matter which variable I type in it always ends up with "The name ("variable name") does not exist in the current context" in the "value" row.

I have an array of several objects created from a class and I would like to track all of them and their variables, so can someone please explain me how can I do this properly?
User is offlineProfile CardPM
+Quote Post

jacobjordan
RE: Debugging Technique
18 Aug, 2008 - 05:01 PM
Post #2

class Me : Perfection
Group Icon

Joined: 11 Jun, 2008
Posts: 1,163



Thanked: 32 times
Dream Kudos: 1625
My Contributions
QUOTE
I've tried typing a variable name into a watch window in the "name" row, while in break mode in the IDE, but no matter which variable I type in it always ends up with "The name ("variable name") does not exist in the current context" in the "value" row.

Make sure you typed the variable name in the watch window case-sensitive, and that it is inside the class or method you are stopped at. If you stopped at a breakpoint, and type a variable that is visible from that code, it will display. An easier way to do it is with the Locals box. It will automatically display the variables in the current method, and update them when they are changed.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 04:46AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month