如何设置 natvis 文件?

How do I set up the natvis file?

我正在尝试使用 Visual Studio 2012 的 .natvis 文件在 Watch window 中显示自定义的 class,但我无法显示它。

如果我有这个结构

namespace a {
    namespace b {
        template<class T, class myClass, class myOtherclass> class hereBeDragons;
    }

    typedef b::hereBeDragons<firstParam, secondParam, thirdParam> IWantToSeeThis;
}

我想显示 class IWantToSeeThis 的对象。我需要使用什么语法?

我试过这些:

  <Type Name="a::IWantToSeeThis">
    <DisplayString> Here are my values </DisplayString>
  </Type>

  <Type Name="a::b::hereBeDragons">
    <DisplayString> Here are my values </DisplayString>
  </Type>

  <Type Name="a::b::hereBeDragons&at;&bt;&ct">
    <DisplayString> Here are my values </DisplayString>
  </Type>   

<Type Name="a::IWantToSeeThis&at;&bt;&ct;">
    <DisplayString> Here are my values</DisplayString>
</Type>   

但其中 none 看到导致显示结构。

我已尝试通过创建注册表项来启用诊断,如下所述:

https://code.msdn.microsoft.com/Writing-type-visualizers-2eae77a2

但是当我重新启动 dev studio 时,输出中没有显示任何诊断信息 window。

我已经解决了:

<Type Name="a::b::hereBeDragons&lt;*,*,*&gt;">
<DisplayString>
Here are my values
</DisplayString>
</Type>