Skip to content

How to debug C++/WinRT native modules? #7522

Answered by dgellow
dgellow asked this question in Q&A
Discussion options

You must be logged in to vote

Answering part of my question as that can be useful to others, yes the Visual Studio debugger can be directly attached to the UWP application and breakpoints from the source code work.

Here is a screencast where I set and use a breakpoint then break on an uncaught exception:

Step by step:

  1. Open the *.sln file in Visual Studio
  2. Run the React Native for Windows via npx react-native run-windows (or just yarn windows)
  3. In Visual Studio, use the menu "Debug > Attach to Process" and select the application from the list. Then click on "Attach"

I still haven't found a way to use logs though.

Edit: I marked this comment as "answer" but feel free to add your comments about debugging strategies, I'm…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by dgellow
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dgellow
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants