2

I am writing a natvis file for visual studio 2012 to help customize what is displayed while debugging. I'm trying to cast a void* to a template class & I'm seeing the following error:

Fatal error: Element CDIB' is unexpected according to content model of parent element

Here is my code:

<?xml version="1.0" encoding="utf-8"?> 
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> 
<Type Name="CDIBPtr"> 
  <DisplayString>(CRefCountRep<CDIB>*)m_rep</DisplayString> 
</Type>
</AutoVisualizer>

Any ideas?

Mat
  • 202,337
  • 40
  • 393
  • 406
Erin Bz
  • 33
  • 5

1 Answers1

3

Angle brackets must be escaped according to XML rules. It should be.

<?xml version="1.0" encoding="utf-8"?> 
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> 
  <Type Name="CDIBPtr"> 
    <DisplayString>(CRefCountRep&lt;CDIB&gt;*)m_rep</DisplayString> 
  </Type>
</AutoVisualizer>
Marius Bancila
  • 16,053
  • 9
  • 49
  • 91