MSVC 2022 / natvis definition only shows in datatip but not in local/watch window

67 Views Asked by At

I defined a natvis file like this:

enter image description here

and I can see the effect in the Datatips when hovering over a variable name:

enter image description here

But the definition not use in the Local or Watch window in the debugger:

enter image description here

Only the stand view is shown, and the display string isn't taken into account at all.

Is there a particular option to tell MSVC to use natvis definitions in Local/Watch view too?

1

There are 1 best solutions below

0
iwarv On

I only just recently started looking into NATVIS and I had this exact same problem. In my case, I had to go into the debugger settings (Debug / Options) and disable the tick box for "Show raw structure of objects in variables windows".

Mine is Visual Studio 2019 though, so menu options may differ.