4

I have also posted this on the MSDN forum here: MSDN Forum Post

When using the /clr option with a Visual Studio C++ project, the debug visualizer for std::string and other types don't seem to be working. Here are the steps:

  • Launch VS2012 or 2013
  • Create a new Visual C++ / Win32 Console Application
  • In the main .CPP file, add: #include <string>
  • In the main method, add: std::string s = "abc";
  • Debug the program and inspect the variable 's'. Notice how it shows the string "abc". This is what we want.
  • Open the project properties / General. Set "Common Language Runtime Support" = "Common Language Runtime Support (/clr)"
  • Debug the program and inspect the variable 's'. Now the string "abc" does not appear.

Further info:

I can see debug visualizer definitions for std::basic_string in both the autoexp.dat and stl.natvis files for Visual Studio. However it appears to be ignoring these when /clr is used. One way I'm confirming that it's actually ignoring these definitions is by putting extra text in them. When /clr is not used, VS shows the text in preview; with /clr on, it does not.

There are other similar threads about this such as:

However, all of these threads seems to indicate that autoexp.dat and/or natvis files are used and can be modified. In my case, I believe these files are being completely ignored when /clr is used.

Does anyone know of a work-around?

Community
  • 1
  • 1
mexxmann
  • 41
  • 2

0 Answers0