question

SmilingMoon avatar image
0 Votes"
SmilingMoon asked SmilingMoon commented

UWP Full Trust project's Window Form is NOT attached to debugger on Start, why?

Regarding UWP with Desktop Extension project sample from Sefan's blog:




When I run the "Package project in debug mode, I can set the break point in UWP app code. But, break point in .NET Framework (WinForm app) does NOT work. If I detach and attach again the process, debug break point starts work.
Why does it happen? How can I fix this?

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

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered SmilingMoon commented

Hello,

Welcome to Microsoft Q&A!

In order to debug the fulltrust process in your UWP project, you need to start the UWP process without visual studio (run it by clicking app's icon) . Then attach to the debugger to the fulltrust process and your breakpoints will be hit.

The detail steps, please deploy your app into 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 (desktop extension process). Then you could debug the WPF app as expect.

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.




· 1
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.

Anyway, I have to attach the exe again.
I prefer to run UWP app from VS first, then detach and attach the Win app for debug. Then, I can debug both.
I just wanted to save the "detach and attach again part.", But it seems not supported that way.
Thank you,

1 Vote 1 ·