uwpdevtoolswebview2

I can't open DevTools in a signed UWP WebView2 application


I am using a WebView2 control in an UWP application to render an online webpage. I want to open the DevTools for the debug purpose, but I can't.

I tried several ways to open DevTools but failed.

  1. Press F12
  2. Press Ctrl+Shift+I.
  3. Right-click the page and then select Inspect
  4. use the OpenDevToolsWindow API

I also tried WPF application, it's ok to open DevTools, only signed UWP application can't. Is there a reason for this?

Thanks for your future answer.


Solution

  • This is a known issue in a signed UWP.

    To use Microsoft Edge DevTools to debug a WebView2 WinUI 2 (UWP) app, use remote debugging. Remote debugging is necessary for WebView2 WinUI 2 (UWP) apps because currently, the built-in DevTools can't be launched inside a store-signed WebView2 WinUI 2 (UWP) app.

    Remote debugging