50

I have a asp.net mvc 5 project. When I try to start debugging with enabled Script debugging mode, and using Chrome, the Visual studio 2017 shows the error:

enter image description here

It works when I set 'Enable legacy Chrome JavaScript debugger for ASP.NET' in Visual Studio debugging options:

enter image description here

But how can I solve this issue without enabling legacy Chrome JavaScript debugger?

2
  • I removed Visual Studio 2017, installed VS 2019, then reinstall VS 2017, and it works
    – Andrii
    May 16, 2020 at 10:57
  • I have been getting this on a nearly new .net 5 web app, VS 2019, debugging with IIS Express. It seems to happen when I add lines in Startup.ConfigureServices(), and once it starts happening, I have to reboot the machine to make it go away. Restarting Visual, returning to a working commit, deleting .vs, nothing less than a reboot seems to work. This could really finally drive me nuts.
    – bbsimonbb
    Nov 10, 2021 at 8:56

11 Answers 11

118

I've found it's easiest to never use JavaScript debugging in Visual Studio. In my honest opinion, the Chrome JavaScript debugger is a much better alternative for debugging.

To turn off debugging and fix the error in VS2019, go to Tools > Options > Debugging > General. Uncheck the following option:

enter image description here

5
  • 8
    >Chris, Thanks, this is a straight forward answered for VS 2019. It works like charm. Jan 14, 2020 at 9:01
  • @Chris - Thanks so much. This has been plaguing me forever and your fix works perfectly.
    – Buckles
    Apr 3, 2020 at 17:18
  • 1
    Never had a problem with VS 2019, till this morning. Unchecking Javascript debugging worked for me. Feb 4, 2021 at 8:46
  • If you still want to have VS debugger linked to your JS file, you can refresh your IIS Express as in my case it forced iisExpress to open on a project on the wrong port. stackoverflow.com/questions/42182304/… Aug 31, 2021 at 14:14
  • this also worked for me, however I dont see why this is causing an issue, since it only ever appears to happen when switch btwn git branches when inside vs
    – d0rf47
    Dec 15, 2021 at 14:25
11

delete .vs folder from project folder

9

For me it worked when I closed all the instances of the browser and re-run.

1
  • I had a browser window that opened up on another screen that I couldn't see while using remote desktop.
    – Cryptc
    Nov 9, 2022 at 16:40
4

I just unchecked the option. It's working for me:

enter image description here

4

Following trick work for me

  • click on browser selector and disable the script debugging Disable script debugging
1
  • This worked for me, for whatever reason.
    – carloswm85
    Jun 15, 2022 at 21:26
3

Unfortunately, this is a known issue that the Microsoft people has put on the back burner. https://developercommunity.visualstudio.com/content/problem/641639/failed-to-launch-debug-adapter-for-google-chrome-o.html

2

There are many variations of this error being asked about all over. Since this is the top of my search engine I'll answer here:

I had installed another file editor (Code Writer) that set itself as the default program for a whole host of files that were previously set to Visual Studio. Between a combination of doing a VS Installer Repair, and manually changing other associations back to VS, and a reboot, it's working for me again.

2

In my case, for Visual Studio 2019 in chrome browser, it was loading empty, and in edge browser, it was trying to open some file from local.

  1. I unchecked(toggled) Enable Javascript debugging for ASP.Net
  2. Closed the browsers.
  3. Removed the .vs folder from the root solution directory (this step may not be required)
  4. Built the solution.

It started working.

enter image description here

1

For me it worked if I just unchecked the option -> build, then I checked it again.

1
  • This may look like a bad answer. But it fixed it for me ¯_(ツ)_/¯
    – Maarten
    Aug 31, 2020 at 14:33
1

I just clicked the Build tab, then clicked Build Solution. No more error and the solution ran fine after.

0

I had the same issue and attempted the above but it didn't resolve the issue. I had to repair visual studio using the visual studio installer to fix the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.