How to handle similar class names in different solutions using your own visualizers

In my company, we work with our own visualizers (.natvis files) for debugging memory dumps in Visual Studio.

Since we have the same class names for different projects, we are thinking of including .natvis files in the description files, and this seems to work: .natvis files are embedded in symbol files (* .pdb) during build, which is good.

Unfortunately, now it is impossible to perform any configuration: from .natvis files (a file on a PC and from a file in a symbol file), which takes precedence in a symbol file, which makes it unchanged, so no configuration seems to be possible more.

To have custom .natvis files, we are thinking of changing the sequence of .natvisreload. Is this possible or is there another approach for this (for example, adding parameters to a command .natvisreload)?

+4
source share
1 answer

My question seems impossible to answer, as mentioned in the natvis scheme I just found on my PC:

The natvis files that are part of the downloaded project will always take precedence over the files in the natvis user directory

It seems that you can distinguish different solutions (applications) in one natvis file, as you can see here:

  <!-- Solution1 -->
  <Type Name="Class_Name">
    <Version Name="Solution1.exe" Min="1.0" Max="99.99"/>
    <DisplayString>Class_Name Solution1 {m_strName}, {m_iID} </DisplayString>
  </Type>

  <!-- Solution2 -->
  <Type Name="Class_Name"> // in Solution2 Class_Name has no strName
    <Version Name="Solution2.exe" Min="1.0" Max="99.99"/>
    <DisplayString>Class_Name Solution2 identifier {m_iID}</DisplayString>
  </Type>
+3
source

Source: https://habr.com/ru/post/1689461/


All Articles