How to debug a .exe launched from Full​Trust​Process​Launcher

Viewed 1123

I have built a UWP app, and a WPF app within the same solution. I am using the Full​Trust​Process​Launcher class to launch the WPF app from the UWP app. I am also using the App​Service​Connection class to allow the two apps to communicate with each other. This all works fine in a basic scenario. But once I start really developing my WPF app beyond the samples I can find I will need to start debugging in visual studio.

I've tried the following:

  1. Set breakpoints within the WPF code.

Result: I did not expect this to work, and it did not.

  1. Attach to the running WPF process once the UWP launches it.

Result: The "attach" button when the running WPF process is selected is grayed out.

  1. I started investigating the new VS extension "Desktop Bridge Debugging Project" and followed along with samples and documentation.

Result: All of the samples I could find seemed to revolve around converting an existing WPF app to UWP. Because of this, I don't think this is a solution. I could be wrong...

Below is the relevant code for launching my WPF app from the UWP app:

int messageNumber;
    private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
    {
        if (this.messageNumber == 0)
        {
            await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
        }
        this.messageNumber++;

        await AppServiceManager.SendMessageAsync(
          $"Message number {this.messageNumber}");
    }

As I mentioned above, for now i'm just following the Microsoft examples. I would eventually like to add more complex code and be able to debug.

How else can I get debugging features for the WPF app launched from a UWP app?

Thanks

2 Answers
Related