Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2012 - locals have disappeared

While debugging VS2012 I have found that I can no longer access variable values:

  • The Locals window does not show anything (pictured below).
  • The Watch window tells me "Unable to evaluate the expression" for any expression (also pictured below). My personal favourite is that it cannot evaluate true.
  • And mousing-over any variable does not show any values tool-tip.

Image showing no locals

What I've tried:

Restarting Visual Studio

Restarting my computer

Checking that the loaded modules shows debug symbols are loaded

Uninstalling the TeamCity plugin that I installed yesterday

Looking under Tools/Options/Debugging for anything obvious (and disabling other extensions that had been working fine)

EDIT: I've also tried creating a new solution.

I've also noticed that the call stack shows several blank lines where I presume there are supposed to be external method names (pictured above) - I'm not sure if this is relevant, but it is worth mentioning.

like image 253
Jonny Avatar asked Jan 09 '14 14:01

Jonny


People also ask

How do I enable locals 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.

What is Locals window?

The Locals window is a useful window where you can see the values of all declared variables. This window automatically updates as you debug line by line or from breakpoint to breakpoint. The window has three main columns. Under the Expression column, it shows the name of the variable.

What are auto and local windows in Visual Studio debugger?

The Autos and Locals windows show variable values while you are debugging. The windows are only available during a debugging session. The Autos window shows variables used around the current breakpoint. The Locals window shows variables defined in the local scope, which is usually the current function or method.

How do I view variables in Visual Studio?

If you want to continue to watch a variable, you can add it to a Watch window from a data tip. Right-click the variable in the data tip, and select Add Watch. The variable appears in the Watch window. If your Visual Studio edition supports more than one Watch window, the variable appears in Watch 1.


1 Answers

I will add this answer as I had the same problem with a different resolution.

I had mistakenly closed the locals window and could not find it as it was not with other windows under the VIEW menu. I found it under the DEBUG menu Windows option.

or Optionally:

Ctrl+Alt+V, L

like image 131
Thronk Avatar answered Sep 19 '22 19:09

Thronk