Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

one or more errors occurred failed to launch debug adapter Visual Studio 2019

From today morning, my Visual Studio is behaving very strangely. I get the error "one or more errors occurred failed to launch debug adapter" whenever I run the project.

enter image description here

I run my project profile instead of running it in the IIS Express profile. Here is my launchSettings.json file.

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:65498",
      "sslPort": 44318
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "<ProjectName>": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
    }
  }
}

And when I check the Output window, this is what I get.

The program '[22052] .exe' has exited with code -1 (0xffffffff).

Another thing I noticed is that a new browser tab is opened without any URL in it, just an about:blank page.

like image 771
Sibeesh Venu Avatar asked Dec 10 '20 07:12

Sibeesh Venu


3 Answers

I am having this problem too and think it may have something to do with the Edge Browser(or an update?) and the JavaScript Debugger. The first time I run a WebApp, everything works fine. Every time afterwards, I receive the "failed to launch debug adapter" shown above.

I have to either disable the Javascript Debugger or Use Internet Explorer to run the app.

enter image description here

like image 69
zBestData Avatar answered Oct 08 '22 23:10

zBestData


The issue was that the process that got started from my previous execution was still running. When we start the project using the profile project, it will start a new process, and you can see that there is a new Debug console window as in the preceding image.

enter image description here

You can just close this window and run your project again, and that will fix the issues. You can also enable a setting that will close this process when the debugging stops. To do that, go to Tools and then click on Options, select Debugging and then enable the option Automatically close the console when debugging stops.

enter image description here

If you don't see the option, just click on the other options under the Debugging menu, and wait for the contents to load, and then click on the Debugging menu again. Sometimes it was just showing a blank screen without any options. Seems like a bug in Visual Studio 2019.

Also, make sure to close the browser window that was opened from the last execution. For me it was opened, that is the reason why a new tab with about: blank was opening.

Happy Coding!.

like image 30
Sibeesh Venu Avatar answered Oct 08 '22 23:10

Sibeesh Venu


We're having the same problem as zBestData above since moving to Visual Studio 2019, Version 16.9.1.

We don't have much time to look into it at the moment but seems to be related to msedge.exe processes left running after a debug session. As a workaround, before starting a second debug session, close all open Edge windows, then kill any msedge.exe instances (eg in Task Manager).

Otherwise, we find we need to Restart the system to clear the fault.

like image 27
DaveC Avatar answered Oct 08 '22 23:10

DaveC