Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick watch window not showing the variable value in Visual Studio for C++/CLI project

I know that Visual Studio support for C++/CLI is terrible. But I am getting a weird issue when doing a Quick watch. The variable which I am watching is in the scope and it has value. But VS says, the variable is not in the scope. See the image

Quick watch problem in C==/CLI http://www.freeimagehosting.net/uploads/95471b8cb4.png

It would be great if someone can suggest a workaround. Or is this a bug with VS?

like image 203
Navaneeth K N Avatar asked Jul 04 '09 05:07

Navaneeth K N


People also ask

How do I add a variable to a watch in Visual Studio?

Select the variable a in the code. Select Debug > QuickWatch, press Shift+F9, or right-click and select QuickWatch.

How do I view quick watch in Visual Studio?

Open and explore the 'QuickWatch' window in Visual Studio That way we can quickly evaluate or change expressions. The 'QuickWatch' window has three columns: 'Name', 'Value', and 'Type'. They show the expression currently evaluated, its value, and type.

How do I check the value of an immediate window?

To display the Immediate window, open a project for editing, and then choose Debug > Windows > Immediate or press Ctrl+Alt+I. You can also enter Debug. Immediate in the Command window. The Immediate window supports IntelliSense.


2 Answers

I actually made it work by these steps, not sure why this should be the solution though.

  1. checking enabling .net source stepping and enable source server. http://tinypic.com/view.php?pic=987ubn&s=3#.WAM_D5MrK8o
  2. it then loaded all symbols
  3. made a clean build, removed it again and enabled just my code
  4. clean build, voila i got correct debug symbols again!
like image 185
Johan Wikström Avatar answered Oct 25 '22 01:10

Johan Wikström


Is this in Debug or Release? Release builds, even with PDB support, are notorious for poor watches.

like image 28
Assaf Lavie Avatar answered Oct 25 '22 00:10

Assaf Lavie