none
[UWP][C++] Can't visualize native types while debugging a UWP app RRS feed

  • Question

  • Hi all,

    I have a C# UWP app that uses some classes from a C++ WinRT component, which in turn uses a C++ Native DLL.

    My problem is that whenever I debug either the WinRT component or the Native C++ DLL, I can't visualize any native types (e.g. std::map, std::string_view from the standard library). Why, and what can I do to fix?

    The projects are your standard run-of-the-mill C# UWP, WinRT and Native DLL without any major changes to the settings of the project.

    Pictures of the problem.
    WinRT project:


    C++ DLL project:


    (Wish I could a way to attach images instead of embedding them, but I don't see such an option.)


    Maybe this is better suited for the Visual Studio Diagnostics forum? It's hard to tell where to put topics when there are so many forums to pick from.
    • Edited by Athena Saki Wednesday, August 7, 2019 5:42 PM
    Wednesday, August 7, 2019 3:58 PM

Answers

  • Turns out Visual Studio doesn't have visualizers for u8strings and u8string_views... and there appears to be some sort of bug that causes the debugger to be unable to read the internals of the string when using char8_t. The hassle is just not worth it until Microsoft fixes their software.

    I know it's a feature coming in C++20, but come on, if you're implementing something like this in a release version, then at least do it right.

    • Marked as answer by Athena Saki Thursday, August 8, 2019 7:03 AM
    Thursday, August 8, 2019 7:03 AM

All replies

  • Turns out Visual Studio doesn't have visualizers for u8strings and u8string_views... and there appears to be some sort of bug that causes the debugger to be unable to read the internals of the string when using char8_t. The hassle is just not worth it until Microsoft fixes their software.

    I know it's a feature coming in C++20, but come on, if you're implementing something like this in a release version, then at least do it right.

    • Marked as answer by Athena Saki Thursday, August 8, 2019 7:03 AM
    Thursday, August 8, 2019 7:03 AM
  • Hi,

    Glad to hear that you had found a solution. Thanks for sharing it here.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 13, 2019 2:22 AM
    Moderator