Search code examples
windowsuwpsystem.diagnostics

Under what circumstances would a ProcessDiagnosticInfo be associated with multiple AppDiagnosticInfo's?


I'm looking into Windows.System.Diagnostics and have found the ProcessDiagnosticInfo.GetAppDiagnosticInfos() method. I was expecting that for a given process, there would only be one app associated, not multiple, so why is this returning a List? What circumstances would cause this to return more than one value?


Solution

  • Seems I found the answer shortly after asking.

    For any process associated with a UWP app, the IsPackaged property is true. So, for each of these, you can get from the ProcessDiagnosticInfo to the AppDiagnosticInfo. It might seem strange that we can get AppDiagnosticInfos (plural) from a process – but this is to allow for the possibility that a single process is associated with more than one app. That’s an extremely uncommon scenario, but it is possible in the case of VoIP apps where two or more apps in the same package can share a component running in a separate process at run time. In almost all cases, though, there will only be one AppDiagnosticInfo per process.

    https://blogs.windows.com/buildingapps/2017/06/28/uwp-app-diagnostics/#IXiAlM28HfPWx0hT.97