2

I was following Microsoft documentation of how to create and consume an app service by a UWP app https://learn.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service

The background service is a Windows Runtime Component and the full source code can be accessed through the above link.

I am trying to debug the Run() method in Inventory.cs, however, breakpoints don't work due to symbols not being loaded (there's a .pdb file though for the project) and Debug.WriteLine or Console.WriteLine does not write to the output window.

Things I have tried:

  • Running the app in Debug mode (not Release)
  • Running the app with debugger attached in VS (pressing F5) (not just starting an instance without a debugger)
  • "Redirect all output window text to the immediate window" is NOT checked
  • "Define DEBUG constant" and "Define TRACE constant" are checked
  • Right-click in the output window and ensure "Program output" is checked
  • Supplying the .pdb file of the Windows Runtime Component app (breakpoints are still not hit)

Things I have not yet tried:

How can I debug this Windows Runtime Component Inventory.cs methods?

Matthew C
  • 616
  • 3
  • 10
  • 18
  • Have you tried this [document](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/debug-a-background-task#trigger-background-tasks-manually-to-debug-background-task-code)? – Nico Zhu Oct 24 '19 at 03:08

0 Answers0