Web API Debugging in Microsoft Edge Not Working
When I try to debug a WASM blazor project in Microsoft Edge, I get a blank page (screenshot) even though I have the App URL set (screenshot). After I manually type the localhost url, the web page works fine for about 60 seconds, then Visual Studio gives me an error message (screenshot) and stops debugging. I've googled this error message relentlessly, but have not found a solution.
The story behind this is that I've always used Chrome as my debug browser. However, for some unknown reason, the company I work for has decided that Chrome is a security risk and disabled it using Group Policy. So I'm trying to use Edge in Windows 10, and this is the issue I'm having on two separate machines. I suspect there is some other security setting in group policy that is causing the issue, but I don't have enough information about what Visual Studio is trying to do that I can take to the service desk and ask them to reverse it or give me an exception.
Any help would be appreciated, I'm desperate. Thank you.
1 Reply
I dug a bit more into the verbose js debugger logs and found this message, which seems to suggest the problem is Visual Studio trying to connect to a javascript debugger?
{"tag":"dap.send","timestamp":1736790398783,"metadata":{"connectionId":0,"message":{"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/dap/operation","data":{"errors":[],"launch":{"operation":"launch","totalTime":60217.6,"max":60217.6,"avg":60217.6,"stddev":null,"count":1,"failed":1},"!launch.errors":[{"error":{"message":"Unable to launch browser: "Timed out after [object Object] ms while trying to connect to the browser!"","name":"Error","stack":"Error: Unable to launch browser: "Timed out after [object Object] ms while trying to connect to the browser!"\n at a (vsDebugServer.js:98:8429)\n at Zc.doLaunch (vsDebugServer.js:98:8510)\n at Zc.launch (vsDebugServer.js:98:9712)\n at tg.captureLaunch (vsDebugServer.js:111:11912)\n at tg._launch (vsDebugServer.js:111:11659)\n at async Promise.all (index 6)\n at tg._boot (vsDebugServer.js:111:10783)\n at vsDebugServer.js:111:9714\n at xa._onMessage (vsDebugServer.js:33:4942)"}}],"launch.errors":[{"error":{"message":"Unable to launch browser: "Timed out after [object Object] ms while trying to connect to the browser!"","name":"Error","stack":"Error: Unable to launch browser: "Timed out after [object Object] ms while trying to connect to the browser!"\n at a (vsDebugServer.js:98:8429)\n at Zc.doLaunch (vsDebugServer.js:98:8510)\n at Zc.launch (vsDebugServer.js:98:9712)\n at tg.captureLaunch (vsDebugServer.js:111:11912)\n at tg._launch (vsDebugServer.js:111:11659)\n at async Promise.all (index 6)\n at tg._boot (vsDebugServer.js:111:10783)\n at vsDebugServer.js:111:9714\n at xa._onMessage (vsDebugServer.js:33:4942)"}}]}}}},"level":0}
If anyone runs into the same problem as me, I found the problem. It's a registry setting that was changed in Group Policy: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\RemoteDebuggingAllowed
It needs to be set to 1