question

Allanjb avatar image
0 Votes"
Allanjb asked Allanjb commented

How to debug a desktop extension component in a UWP Package.

I have been working through the examples illustrated in Stefan Wick's blog on UWP with Desktop Extensions.
See: uwp-with-desktop-extension-part-1 to uwp-with-desktop-extension-part-3

While I can build the examples in VS2019 and debug the UWP project, (uwp.exe) I cannot debug the FullTrust app which is run as service, (FullTrust.exe) This is the case for all 3 of the examples illustrated in the article. The example that most closely fits my needs is illustrated in the 3rd of Stefan's examples.

I cloned the projects from Github: UWP-FullTrust
Reading all the documentation on debugging packaged apps it should be straight forward but I can't figure it out. FullTrust.exe does not show as a module in the debugger.


windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered Allanjb commented

Hello,

Welcome to Microsoft Q&A!

In order to debug the fulltrust process in your UWP project, you will have to start the UWP process without debugging (or detach the debugger from it). Then attach to the debugger to the fulltrust process and your breakpoints will be hit.

First, please deploy your app to your device. Then run your app from the Start Menu. Please remember to start the desktop bridge app instead of a single UWP app or a single WPF app. After, go back to Visual Studio, find the Debug button on the top bar. Click the Debug and choose Attach to Process. It will show a window and you could choose the WPF process. Then you could debug the WPF app as usual.

Thank you.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi: While I can follow your guide and load the wpf app into the debugger, I cannot get the debugger to stop at my breakpoints.
The pdb file is being created for the app.
There are no modules being loaded for the wpf app also...

0 Votes 0 ·

Please do not load the WPF app, just run the desktop bridge app that you packaged. Then you could attach the debugger to the WPF app.

0 Votes 0 ·

Hi: Here are the steps I took:
I ran the app from the start Menu with VS2019 open with my project. I then ran the desktop code from the button on the page, (UWP Desktop Extension Sample 1). I then attached to the FullTrust wpf app and set a breakpoint after the "Press any key to continue" wait command. The app did not break at my breakpoint.
I tried also running the app from VS2019 without loading the debugger and attaching to the wpf process, no luck there also.
Tried for all the examples with the same result.

0 Votes 0 ·
Show more comments