8

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 ProcessMonitors logs.

4

3 回答 3

16

我终于想通了。启用“编辑并继续”时,Natvis 可视化工具不起作用。

于 2013-07-23T22:05:41.040 回答
4

我有同样的问题。

检查 Tools->Options->Debugging->General-> Show raw structure of objects in variables windows。它应该被禁用。

于 2016-03-04T11:36:33.507 回答
0

我刚刚意识到,%USERPROFILE%\Documents\Visual Studio 201x\Visualizers如果您使用 ReSharper Test Runner 调试测试,则不会使用自定义 NatVis 文件(位于 中的文件)。然而,内置的,例如 forstd::vector正在工作。

如果您定期运行测试(即Debug -> Start Debugging,可能是 F5),您的自定义 NatVis 文件将被加载和使用。

于 2017-04-20T10:19:54.673 回答