locked
Tracking down a Platform.DisconnectedException

    Question

  • Hi all,

    I have an app where the majority of the UI is written in XAML/C# but one major control is written in C++/CX.

    I keep getting this Platform::DisconnectedException. I have no stack trace and so I have no idea where it might have come from.

    I went looking a bit for other posts about this DisconnectedException. The only thing relevant I could find was here:

    http://social.msdn.microsoft.com/Forums/en-US/3fc390ce-3f92-45a1-842e-e1b79c56566e/exception-raised-during-event-call-in-a-lambda-function?forum=winappswithnativecode

    It leads me to believe that the problem might be originating in my C++/CX component where we do a lot of work in background threads. Hence it might happen either when we switch to the background or back to the UI thread.

    However, before I start diving into this mess, I would like to ask people here if there might be some good ways to track down a problem like this? Also, what are the known causes for this type of exception? Looking at the class itself, it only says "Thrown when an object has disconnected from its clients." which doesn't help me beyond where I already am.

    Thanks,

    Tomas Hofmann

    Monday, April 14, 2014 10:11 PM

All replies

  • I've never heard of this exception before, but it does sound like it's a problem in the C++ component. I think you should attach the debugger to the process and monitor for the exception in a live debug session.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, April 15, 2014 1:25 PM
    Moderator
  • Thanks Matt,

    I should have been more clear. I have a stack trace, and it looks like this:

      

    > KernelBase.dll!75f52c1a() Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
    [External Code]


    Which means I have very little to go with. It is however consistent with the possibility of launching a thread and then having my control deleted when it goes out of scope, only to leave me with a "hanging" this pointer or so. Of course, it could also be a ton of other things...

    Tuesday, April 15, 2014 3:48 PM
  • You might want to try pointing your application to the Microsoft Symbols server to see if it helps resolve anything.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, April 15, 2014 6:02 PM
    Moderator