This may be one of the strangest errors I got from Visual Studio 2022 (17.6.3) in a long time:
I got this error when I tried to start our web application in debug mode. It worked without any problem for a long time and that error only happened on my machine – everyone else in the team could run it in debug mode without any problems. It also only happened with Chrome, other browsers like Edge worked as expected.
After an annoyingly long time, I could identify the trigger for this error. In the launchsettings.json we added months ago the inspectUri
property to debug the Blazor application:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "profiles": { "Web.APP": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:***;http://localhost:***" } } |
With this line I now got the error above, without the line everything worked as expected. To fix the problem for now we decided to “comment out” the property by appending two _
:
1 2 3 4 5 6 7 8 |
{ "profiles": { "Web.APP": { ... "__inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", ... } } |
Should you run into an error about Puppeteer, check if you have a similar setting in the launchsettings.json
file.