Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to watch all variables when debugging in Visual Studio 2012

Is there a way to watch all variables when debugging in Visual Studio 2012 like i can do it in IntelliJ Idea 12? I have a window with all the variables(both global and local) when debugging in Idea and i want the same thing in VS 2012 (Autos window is not enough) . Help is very much appreciated. EDIT: All variables means variables that were already declared in code like:

Class Example
  Dim i as Integer
  Sub test()
   Dim a as String
   Dim b as Double
  End Sub
End Class

When I enter test() Autos window no longer displays i.

like image 264
Dobrobobr Avatar asked Dec 05 '13 11:12

Dobrobobr


People also ask

How do I see variable values in Visual Studio debugging?

Hover over a variable to see its value. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.

How do I view local variables in Visual Studio?

To open the Locals window, while debugging, select Debug > Windows > Locals, or press Alt+4. This topic applies to Visual Studio on Windows.


1 Answers

Many options:

  1. Autos While debugging you can enable 'Autos' which will show you values by every member on your class. Go to menu Debug->Windows->Autos to make it appear.

  2. Locals While debugging you can enable 'Locals' which will show you all variables in the current stack frame. Go to menu Debug->Windows->Locals to make it appear.

  3. Watch Although it is a little manually you also can use 'Watch' you can drag and drop any variable to this window or right click then add to watch. Go to menu Debug->Windows->Watch to make it appear. Note. You can enable more than one watch window :).

  4. Mouse over Finally you can go over the variable with the mouse and you will see the variable's value.

like image 160
Marco Medrano Avatar answered Sep 24 '22 07:09

Marco Medrano