54

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!

Arvind Maurya
  • 910
  • 12
  • 25
M. T.
  • 579
  • 1
  • 4
  • 3
  • 3
    That *is* about what it costs to take the time for a support engineer to step you through your machine configuration and ensure that anti-malware and firewall shovelware can't block the usage of that port. – Hans Passant May 11 '18 at 21:47
  • 4
    Opening a support call with guaranteed response times does cost money. You're paying to get special treatment. Reporting the issue to try and get it fixed is free: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017 –  May 15 '18 at 09:03
  • `they want $499 for the pleasure` no they don't. Unless you use a *pirated* VS copy and want free support instead of submitting an issue (which is free). You don't need to *pay* in the first place, Visual Studio Community is free. – Panagiotis Kanavos Jun 05 '19 at 07:10
  • As for "free support" in general, this last year you've probably seen the opinion of open source project maintainers about people demanding free support. – Panagiotis Kanavos Jun 05 '19 at 07:13
  • Try to close VisualStudio and run it again. That fixed it for me. – tedi Jul 22 '22 at 11:02

18 Answers18

49

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
  • 1
    I had the first setting enabled, but the second was not. I enabled that second option and it now seems to work. Thanks for the info. –  May 15 '18 at 09:14
  • 1
    Thanks that fixed it :) – M. T. May 17 '18 at 07:24
  • I found this in VS 2017, but not in VS 2019, the "Legacy Chrome Javascript debugger for ASP.NET" isn't an option - just an FYI. Closing all tabs, and the browser I was using to launch/debug worked for me. – LatentDenis May 31 '19 at 13:58
  • 2
    This did nothing to resolve the issue. Only closing out the all browsers fixed it for me. – Mike Jul 18 '19 at 11:51
48

I solved this with:

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

  • Disabled JavaScript debugging for Asp.Net (Chrome, Edge and IE)
Camila Alvarado
  • 563
  • 4
  • 5
20

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.

Muhammad Bilal
  • 1,008
  • 13
  • 14
  • Same here. For both VS 2017, and 2019. – LatentDenis May 31 '19 at 13:59
  • 1
    I closed all browser tabs and re-run the app, it works for me! – Raj K Jun 15 '20 at 07:21
  • This worked for me in Visual Studio 2017. I closed all browser tabs (i.e., I quit Chrome to close all of its windows), started debug again, and it started Chrome with a tab for the debugged page and it worked. – M Katz May 02 '21 at 15:46
  • there was a process still open for the browser i use for debug (i wasnt aware of), even though it wasnt open on the desktop. killing this process fixed the issue. disabling js debug also worked, but i knew that couldnt be the "correct" fix. thanks for posting this answer. – Heriberto Lugo Dec 25 '22 at 08:16
8

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)
carltonstith
  • 154
  • 3
  • 9
4

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.

Ani
  • 431
  • 3
  • 7
3

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

    1. 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

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

Rajnikant
  • 2,176
  • 24
  • 23
3

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)

2

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.

Charley M
  • 21
  • 1
1

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

1

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.

JessS
  • 73
  • 1
  • 7
1

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.

1

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

tyne
  • 97
  • 5
1

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

enter image description here

lomec
  • 1,356
  • 1
  • 11
  • 10
0

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Rohil Patel
  • 386
  • 3
  • 8
0

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

0

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.

Rajdeep
  • 788
  • 7
  • 26
0

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!

Andy Brown
  • 5,309
  • 4
  • 34
  • 39
0

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

Steve
  • 396
  • 1
  • 5
  • 8