Debug WinJS application in production

104 Views Asked by At

Given there's installed third-party Windows Store application that needs to be trouble-shooted and debugged, what are the options to debug it? Some values may not be serializable, a logger would be useful but less preferable.

This is WinJS application that has source code (C:\Program Files\[appname]\index.html and \js) available that can be tampered if necessary, yet it uses WinJS API and native DLL components, so it can't be executed in a browser.

Can it be connected to a debugger in its current state? In case this is possible, can this be done remotely? Currently Visual Studio is installed on another local machine.

The existing questions seem to address only first-party Windows Store applications that can be developed the normal way.

2

There are 2 best solutions below

1
Shakeel On

You can remotely debug with visual studio

  • Install the Windows Debugger on the machine where the third-party application is running.
  • In the application's source code, add breakpoints or debug logging to identify the issues. Build and deploy the modified application to the machine.
  • On your local machine with Visual Studio, attach the debugger to the remote process running the application.

The documentation can explain to you how to configure it. Link to remote debugging: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2022


Use Diagnostic Tools

Windows offers diagnostic tools that can help troubleshoot issues in Windows Store applications.

Link to resource: https://learn.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-recorder


Also Check the forums of the third-party tools, maybe they have recommendations or workarounds.

0
Krishan Saini On

Not sure if we are on the same page but there are a couple of ways to debug using VS.

  • Local Debugging:
    • Enable developer mode on PC: Settigns -> Update & Security -> For Developers -> Developer mode.
    • Start your app to debug.
    • Open Visual Studio, find Debug -> Attach to Process and find app's process.
  • Remote Debuggind
    • Install Visual Studio Debugging Tools on target machine.
    • Run Remote Debugger on target machine and note its machine name and port.
    • In Visual Studio on your local machine, go to Debug -> Attach to Process.
    • Enter the target machine's name and port in the Qualifier field, refresh, find the app's process and attach.

Just make sure, you have the right permissions to debug third party apps and backup your origin al files beofre any modifications.