none
Debugger Visualizer not shown when using CLI/C++

    Question

  • Hi

    I wrote a debugger visualizer to show some XML in a form more appropriate to how the XML is being used in our app for an XmlElement object. The visualizer is written in C#, but the app where it will be used is written CLI/C++, but an XmlElement is a managed type so the visualizer should be available, but it isn't. You don't get the magnifiying glass when you highlight the XmlElement object.

    As an aside I know that an XmlElement is not serializable so I use a class derived from VisualizerObjectSource to create a custom class which serializable to 'marshal' the data I want from the XmlElement target.

    Anyway, the visualizer works fine for a test program also written in C#,when I say it works fine I mean that the magnifiying glass is shown and the visualizer is available when you select an XmlELement. I'm not talking about using the VisualizerDevelopementHost object (althought that works fine too, both for C# and CLI/C++ test programs).

    So I thought maybe there's an issue with having the visualizer in C# and the target app in CLI/C++, although there shouldn't as the target type of XmlElement is managed in both cases. To test this I wrote ported the visualizer I wrote in C# to CLI/C++, so now both the target app and the visualizer are both in CLI/C++, but the visualizer still didn't show. However if I went back to my C# test program both visualizers (ie the C# one and the CLI/C++ one) are both now available.

    So what I am missing to get a debugger visualizer to work for CLI/C++? I tried changing /clr to /clr:pure etc but it didn't make any difference.

    Is there some extra attribute you need to add to the visualizer assembly to get it show up in CLI/C++?

    Thanks
    Howard
    Friday, July 10, 2009 2:40 PM

Answers

  • After more poking around it seems as though writing your own custom visualizer is NOT support for CLI/C++ debugging only C# & VB, see this link http://www.eggheadcafe.com/conversation.aspx?messageid=31235024&threadid=31144802

    The autoexp.dat file is for display visualizations of native types. The managed equivalent of that is autoexp.cs and autoexp.dll. But this won't let you display a visualizer.

    I wish microsoft would make things like that clear in doc as in the section "how to: use a visualizer" they say that visualizers apply to C++ managed types, when clearly they don't.
    • Marked as answer by Nancy Shao Friday, July 17, 2009 2:27 AM
    Tuesday, July 14, 2009 11:21 AM

All replies

  • The C++ debugger aparently needs a little hinting using the autoexp.dat file google around for it since official documentation hard to come by as it seems.
    • Marked as answer by Howard7 Monday, July 13, 2009 4:52 PM
    • Unmarked as answer by Howard7 Tuesday, July 14, 2009 11:14 AM
    Friday, July 10, 2009 3:21 PM
  • ok, thanks for the reply Ray, I'll check it out.
    Monday, July 13, 2009 4:54 PM
  • After more poking around it seems as though writing your own custom visualizer is NOT support for CLI/C++ debugging only C# & VB, see this link http://www.eggheadcafe.com/conversation.aspx?messageid=31235024&threadid=31144802

    The autoexp.dat file is for display visualizations of native types. The managed equivalent of that is autoexp.cs and autoexp.dll. But this won't let you display a visualizer.

    I wish microsoft would make things like that clear in doc as in the section "how to: use a visualizer" they say that visualizers apply to C++ managed types, when clearly they don't.
    • Marked as answer by Nancy Shao Friday, July 17, 2009 2:27 AM
    Tuesday, July 14, 2009 11:21 AM
  • Hi,

    Thanks for your feedback. We are indeed sorry for any inconvenience this may have caused. If you really have concern on this, I’d like suggest you can also add a comment in "How to : Use a Visualizer" article, and our Engineer will pay atttention to it.

    Improving the quality of our products and services is a never ending process for Microsoft .

    Thanks for your understanding.

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, July 15, 2009 10:27 AM