[SOLVED] Failed to Launch Debug Adapter

When you are trying to develop an application by using Visual Studio and trying to debug the code, you might get the issue with the error message saying “One or more errors occurred. Failed to launch debug adapter. Additional information may be available in the output window, exception of type ‘Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException’ was thrown.

So, here is the problem as shown by the error description. Basically, one issue is related to the debug process and the second one is having the exception detail such as ‘Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException’. it means there are a few issues with the Visual Studio and its throwing above exception.

[SOLVED] Failed to Launch Debug Adapter

This kind of issue usually happens when trying to debug the application or when trying to run the application from the Visual Studio IIS Express web server. A lot of people who have encountered this issue hope that Visual Studio will fix it in the future releases.

Then, what should you do if you are having this issue? A writer from Techstrology named Sreenivasa Rangan TR shared his experience and the method to fix the issue. According to him, he observed there was one browser instance that was already created and opened in his previous debug and run of the application using Visual Studio when he tried to solve the issue. He stated that in order to solve the issue, all that you have to do is to close the browser instance that was already created before during your previous application run using Visual Studio.

Once again, the method to solve the issue is really simple, just like most issues that occur during debugging the application or running the application using Visual Studio. In most cases, the issue will be fixed by restarting the Visual Studio application.

Talking about the same error, a user called dazinator on the forum or community known as donet / aspnetcore shared about his experience. Basically, he was seeing the error with Microsoft Visual Studio Professional 2019 Version 16.8.2 and Microsoft Visual Studio 2019 Community version 16.9 Preview 1 when he was trying to upgrade his .net core 3.1 based solution to .net 5.0. When he was trying to launch his asp.net core project with visual studio debugger fails. Here is the message that was shown on his screen:

One or more errors occurred.

Failed to launch debug adapter. Additional information may be available in the output window.

Exception of type

‘Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.ProtocolException’ was thrown

When he was looking in the output window, he received a path to the verbose output log and belwo is the relevant info:

{“tag”:”runtime.launch”,”timestamp”:1606227038803,”message”:”Launch returned error”,”metadata”:{“error”:{“message”:”Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\””,”stack”:”Error: Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\”\n at k.prepareLaunch (c:\\program files (x86)\\microsoft visual studio\\2019\\preview\\common7\\ide\\commonextensions\\microsoft\\jsdiagnostics\\debugger\\debugAdapter\\out\\src\\targets\\browser\\browserLauncher.js:102:19)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)”},”wasCancelled”:false,”name”:”k”},”level”:2} {“tag”:”dap.send”,”timestamp”:1606227041361,”metadata”:{“connectionId”:0,”message”:{“seq”:16,”type”:”response”,”request_seq”:2,”command”:”launch”,”success”:false,”body”:{“error”:{“id”:9240,”format”:“Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\””,”showUser”:false}}}},”level”:0} {“tag”:”dap.send”,”timestamp”:1606227043301,”metadata”:{“connectionId”:0,”message”:{“seq”:17,”type”:”event”,”event”:”output”,”body”:{“category”:”telemetry”,”output”:”js-debug/dap/operation”,”data”:{“errors”:[],”initialize”:{“operation”:”initialize”,”totalTime”:4.5,”max”:4.5,”avg”:4.5,”stddev”:null,”count”:1,”failed”:0},”!initialize.errors”:[],”initialize.errors”:[],”setBreakpoints”:{“operation”:”setBreakpoints”,”totalTime”:11.3,”max”:2,”avg”:1.3,”stddev”:0.5,”count”:9,”failed”:0},”!setBreakpoints.errors”:[],”setBreakpoints.errors”:[],”setExceptionBreakpoints”:{“operation”:”setExceptionBreakpoints”,”totalTime”:0.5,”max”:0.5,”avg”:0.5,”stddev”:null,”count”:1,”failed”:0},”!setExceptionBreakpoints.errors”:[],”setExceptionBreakpoints.errors”:[],”configurationDone”:{“operation”:”configurationDone”,”totalTime”:0.5,”max”:0.5,”avg”:0.5,”stddev”:null,”count”:1,”failed”:0},”!configurationDone.errors”:[],”configurationDone.errors”:[],”launch”:{“operation”:”launch”,“totalTime”:2932.4,”max”:2932.4,”avg”:2932.4,”stddev”:null,”count”:1,”failed”:1},”!launch.errors”:[{“error”:{“message”:”Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\””,”name”:”Error”,”stack”:”Error: Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: httptroubleshooting.md\n\”\n at k.prepareLaunch (c:browserLauncher.js:102:19)\n at processTicksAndRejections (internaltask_queues.js:97:5)”}}],”launch.errors”:[{“error”:{“message”:”Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\””,”name”:”Error”,”stack”:”Error: Unable to launch browser: \”Failed to launch browser!\n\n\nTROUBLESHOOTING: httptroubleshooting.md\n\”\n at k.prepareLaunch (c:browserLauncher.js:102:19)\n at processTicksAndRejections (internaltask_queues.js:97:5)”}}]}}}},”level”:0} {“tag”:”dap.send”,”timestamp”:1606227043419,”metadata”:{“connectionId”:0,”message”:{“seq”:18,”type”:”event”,”event”:”output”,”body”:{“category”:”telemetry”,”output”:”js-debug/error”,”data”:{“!error”:{“error”:{“message”:”read ECONNRESET”,”name”:”Error”,”stack”:”Error: read ECONNRESET\n at TCP.onStreamRead (internal/stream_base_commons.js:205:27)”}},”error”:{“error”:{“message”:”read ECONNRESET”,”name”:”Error”,”stack”:”Error: read ECONNRESET\n at TCP.onStreamRead (internal/stream_base_commons.js:205:27)”}},”exceptionType”:“uncaughtException”}}}},”level”:0} {“tag”:”dap.send”,”timestamp”:1606227043419,”message”:”Message not sent. Connection was closed.”,”level”:2} {“tag”:”runtime.exception”,”timestamp”:1606227043419,”message”:”Unhandled error in debug adapter”,”metadata”:{“message”:”read ECONNRESET”,”stack”:”Error: read ECONNRESET\n at TCP.onStreamRead (internal/stream_base_commons.js:205:27)”},”level”:3}

Not only that, there is also relevant section from his launchProfiles.json, as follow:

“MyHost”: {

      “commandName”: “Project”,

      “launchBrowser”: true,

      “launchUrl”: “https://localhost:62808/“,

      “inspectUri”: “{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}”,

      “applicationUrl”: “http://localhost:62807/;https://localhost:62808/;”,

      “environmentVariables”: {

        “ASPNETCORE_ENVIRONMENT”: “Development”

      }

    },

It should be noted that if he changes launchBrowser to false, he is able to successfully begin the project and the open the browser and navigate to the URL manually. Apart from that, another thing to take note is that Microsoft Edge is his default browser. When the error persists, it looks like a new empty Microsoft Edge window is created.

To reproduce: That is the best thing that he can do as of now.

Exceptions (if any): The exceptions have been mentioned above.

Further technical details:

    • ASP.NET Core version .net 50
    • Include the output of dotnet – info

.NET SDK (reflecting any global.json):
Version:   5.0.100
Commit:    5044b93829

Runtime Environment:
OS Name:     Windows
OS Version:  10.0.19042
OS Platform: Windows
RID:         win10-x64
Base Path:   C:\Program Files\dotnet\sdk\5.0.100\

Host (useful for support):
  Version: 5.0.0
  Commit:  cf258a14b7

.NET SDKs installed:
  1.1.13 [C:\Program Files\dotnet\sdk]
  2.1.502 [C:\Program Files\dotnet\sdk]
  2.1.503 [C:\Program Files\dotnet\sdk]
  2.1.504 [C:\Program Files\dotnet\sdk]
  2.1.505 [C:\Program Files\dotnet\sdk]
  2.1.507 [C:\Program Files\dotnet\sdk]
  2.1.508 [C:\Program Files\dotnet\sdk]
  2.1.509 [C:\Program Files\dotnet\sdk]
  2.1.511 [C:\Program Files\dotnet\sdk]
  2.1.512 [C:\Program Files\dotnet\sdk]
  2.1.513 [C:\Program Files\dotnet\sdk]
  2.1.514 [C:\Program Files\dotnet\sdk]
  2.1.515 [C:\Program Files\dotnet\sdk]
  2.1.516 [C:\Program Files\dotnet\sdk]
  2.1.519 [C:\Program Files\dotnet\sdk]
  2.1.600 [C:\Program Files\dotnet\sdk]
  2.1.602 [C:\Program Files\dotnet\sdk]
  2.1.800 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]
  3.1.102 [C:\Program Files\dotnet\sdk]
  3.1.201 [C:\Program Files\dotnet\sdk]
  3.1.402 [C:\Program Files\dotnet\sdk]
  5.0.100-rc.1.20452.10 [C:\Program Files\dotnet\sdk]
  5.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0-rc.1.20451.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0-rc.1.20451.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0-rc.1.20452.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]