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:
- Implementing custom Trace Listeners as per this answer https://stackoverflow.com/a/9369940/2359946
How can I debug this Windows Runtime Component Inventory.cs methods?