简体   繁体   中英

User defined natvis files in Visual Studio 2012

I'm trying to use new debug visualizers in my project, but something happened to Visual Studio and it does not pick up my natvis files anymore. I tried copying them to %USERPROFILE%\\My Documents\\Visual Studio 2012\\Visualizers as well as to \\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Packages\\Debugger\\Visualizers but it still fails.

It did work a week ago, but something has broken since then.

I tried repairing Visual Studio but it didn't help.

I tried enabling EnableNatvisDiagnostics in the registry but I didn't get any diagnostic messages in the Output window .

The preinstalled natvis files were working fine though. So I tried to remove one of the preinstalled natvis files: stl.natvis from Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Packages\\Debugger\\Visualizers but Visual Studio was still showing vector as if it had access to stl.natvis file. Does anybody know how to fix this? Is there any other location where Visual Studio loads natvis files from? Maybe there is a registry key for that?

PS. I tried using ProcessMonitor to find out the location from which Visual Studio loads natvis files, but I couldn't find any references in ProcessMonitor s logs.

I finally figured this out. Natvis visualizers do not work when Edit and Continue is enabled.

I had the same problem.

Check Tools->Options->Debugging->General-> Show raw structure of objects in variables windows . It should be disabled.

I just realized that custom NatVis files (those in %USERPROFILE%\\Documents\\Visual Studio 201x\\Visualizers ) are not used if you use the ReSharper Test Runner to debug a test. However the built-in ones, eg for std::vector are working.

If you run a test regularly (ie, Debug -> Start Debugging , likely F5) your custom NatVis files are loaded and used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM