Cannot debug in visual studio 2017

Visual Studio-2017

Visual Studio-2017 Problem Overview


Debug error

I cannot start the debugger in Visual Studio 2017. I get this error >"Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:1904)"

I went to submit an incident to Microsoft but they want $499 for the pleasure. Don't see why I should have to pay when their software is broken!

Visual Studio-2017 Solutions


Solution 1 - Visual Studio-2017

I'm using it successfully with the following options enabled.

In Visual Studio go to: Tools -> Options -> Debugging -> General

  • Enable JavaScript debugging for Asp.Net (Chrome, Edge and IE)
  • Enable Legacy Chrome JavaScript debugger for ASP.NET

Solution 2 - Visual Studio-2017

I solved this with:

In Visual Studio go to: Tools -> Options -> Debugging -> General

  • Disabled JavaScript debugging for Asp.Net (Chrome, Edge and IE)

Solution 3 - Visual Studio-2017

I resolved this issue by closing all browser, tabs and killing all processes in Task manager , then build and run the project, it is working for me.

Solution 4 - Visual Studio-2017

I kept getting this error. The following steps worked for me.

  • Open Tools
  • Go to options
  • Go to Debugging
  • Go to General
  • Uncheck Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)

Solution 5 - Visual Studio-2017

Had the same problem after I tried to put a breakpoint in the javascript code. The project kept opening at "Microsoft/VisualStudio/EdgeAdapter/6e91fadb/landingPage.html" url.

Then followed what @Camila Alvarado said.

  • In Visual Studio go to: Tools -> Options -> Debugging -> General

  • Disabled JavaScript debugging for Asp.Net (Chrome, Edge and IE)

It was solved.

Solution 6 - Visual Studio-2017

On windows 7 and Windows 10 I had same problem, I followed steps from Debugger for Chrome Visual Studio code and solved my problem, Missing bit was I had to append in chrome exe short cut target. Steps

  1. find chrome short by typing chrome in start menu of windows and click "Open File Location" as below enter image description here

  2. now right click on Google Chrome short cut, click on properties and go to Target field, at the end append --remote-debugging-port=9222 as shown below enter image description here

  3. close application by pressing ctr + c, and restart it using npm start, start debugging application, it will hit the break point. Happy days.

Solution 7 - Visual Studio-2017

Somehow you enabled the Javascript debugger that's why this error is occured , So the solution is Go To Tools in Visual Studio Tools -> Options -> Debugger -> General -> Uncheck the Enable the Javascript debugging for ASP.NET(Chrome , Edge and IE)

Solution 8 - Visual Studio-2017

I had the same problem. It was intermittent and only arrived ab out a week ago (after MS update).

I applied the second Debugging option quoted... (Enable Legacy Chrome JavaScript debugger for ASP.NET) and now the problem seems to have gone away.

Thanks

Solution 9 - Visual Studio-2017

This does not fix it, but it seems to eliminate the error. I had this error when the project was built in a new tab instead of a new window. After closing all the tabs in the destination browser the project was built just fine.

Solution 10 - Visual Studio-2017

For me, the problem was the browser. I launched the debug mode with google Chrome and got the error, then I changed the browser to Firefox and worked. It should be an intermittent problem. Maybe a PC restart solves the problem.

Solution 11 - Visual Studio-2017

For me this was the browser as well, I had the web application I wanted to debug in an existing chrome window, when I ran with debugging it was opening in a separate window and displaying the error.

When I closed the web application in the existing chrome window it opened in a new window just fine with debugging enabled.

Solution 12 - Visual Studio-2017

Exit Visual Studio and run again but "Run As Administrator"

Solution 13 - Visual Studio-2017

This problem happens when someone disables JavaScript in Chrome and shuts down the browser. So, when next time you run the project, it does not allow to do so.

In this case, just enable JavaScript, which will solve the problem.

Solution 14 - Visual Studio-2017

at the end of all search i just get answer by changing my browser from chrome to firefox.

Solution 15 - Visual Studio-2017

I used to get this error when running React app and using asp net core API.

But when I first open API and then I launch the React website I didn't get that error, I think its the sequence which has the solution.

Solution 16 - Visual Studio-2017

This happened on my machine in Visual Studio 2019 when I put a breakpoint on a JavaScript line. It came up with some message saying I needed to enable client script debugging (forget exactly what), and then I couldn't debug at all in Edge - I got this:

enter image description here

Curiously it still worked in Chrome. So then I went into Tools / Options and unticked this option, to disable JavaScript debugging:

enter image description here

This solved the problem!

Solution 17 - Visual Studio-2017

Quicker way to resolve the issue is Disable Script Debugging in Running configuration as the image below

enter image description here

Solution 18 - Visual Studio-2017

For me, I am using VS Studio 2019 with a WebSite (not a Web Application). I had the Start URL value set. I changed that to Use "Current Page" in the Property pages of the Web Site Property Page

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionM. T.View Question on Stackoverflow
Solution 1 - Visual Studio-2017Renato Mairesse JrView Answer on Stackoverflow
Solution 2 - Visual Studio-2017Camila AlvaradoView Answer on Stackoverflow
Solution 3 - Visual Studio-2017Muhammad BilalView Answer on Stackoverflow
Solution 4 - Visual Studio-2017carltonstithView Answer on Stackoverflow
Solution 5 - Visual Studio-2017AniView Answer on Stackoverflow
Solution 6 - Visual Studio-2017RajnikantView Answer on Stackoverflow
Solution 7 - Visual Studio-2017Ajit Kumar PandeyView Answer on Stackoverflow
Solution 8 - Visual Studio-2017Graeme ThomsonView Answer on Stackoverflow
Solution 9 - Visual Studio-2017JessSView Answer on Stackoverflow
Solution 10 - Visual Studio-2017Carlos EmmonsView Answer on Stackoverflow
Solution 11 - Visual Studio-2017Charley MView Answer on Stackoverflow
Solution 12 - Visual Studio-2017tyneView Answer on Stackoverflow
Solution 13 - Visual Studio-2017Rohil PatelView Answer on Stackoverflow
Solution 14 - Visual Studio-2017mehrdad mohajjelView Answer on Stackoverflow
Solution 15 - Visual Studio-2017RajdeepView Answer on Stackoverflow
Solution 16 - Visual Studio-2017Andy BrownView Answer on Stackoverflow
Solution 17 - Visual Studio-2017lomecView Answer on Stackoverflow
Solution 18 - Visual Studio-2017SteveView Answer on Stackoverflow