0

I am using the latest version of VS Code. I have the following launch.json:

            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "ApplicationStarted",
                "uriFormat": "https://localhost:%s",
            },

I don't have specific output string when application starts. Should I put one? Where should I put it?

Reference: How do I set the default browser as chrome in Visual Studio Code?

Using the suggest by @Deepak-MSFT results in the following exception:

enter image description here

Kok How Teh
  • 3,298
  • 6
  • 47
  • 85

1 Answers1

0

Try to add "type": "pwa-chrome", under configurations in launch.json file.

Example:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch my cool app",
      "url": "http://localhost:8000"
    }
  ]
}

Reference: Launching browsers

See whether it helps to launch the Google Chrome browser.

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • It launches the browser but there is exception that stops the application debugging session. – Kok How Teh Apr 28 '22 at 10:39
  • Using this approach will hide this error https://github.com/dotnet/aspnetcore/issues/41417 ? – Kok How Teh Apr 29 '22 at 05:06
  • The error you are seeing is a different issue. Based on the exception, it looks like some DLL or library is missing and this is the reason you are getting this exception. It has nothing to do with the above suggestion. So above suggestion will not help you to hide the error but it could help you to launch the project in the Google Chrome browser. – Deepak-MSFT Apr 29 '22 at 05:36
  • Don't think so. I see exception in the javascript but not this .Net core clr exception. – Kok How Teh Apr 29 '22 at 05:45
  • I would like to confirm with you if you remove `"type": "pwa-chrome","request": "launch",` from `launch.json` file then are you able to run your project successfully without any error? Could you please share the error screenshot? I am not getting idea where exactly you are getting it. – Deepak-MSFT Apr 29 '22 at 06:35
  • I get the breakpoint at the CLR exception https://github.com/dotnet/aspnetcore/issues/41417 without the change suggested by you. With your changes, I get different exception at some javascript code. – Kok How Teh Apr 29 '22 at 07:24
  • If possible could you please share that exception that you are getting in the Javascript code? – Deepak-MSFT Apr 29 '22 at 08:47
  • Added in my post – Kok How Teh Apr 29 '22 at 09:27