Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state asp.net asp.net

Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state


For me, the solution (workaround) is to turn off JavaScript debugging on Chrome, which I believe is a new feature introduced in VS 2017.

Go to Tools > Options > Debugging > General and turn off the setting for Enable JavaScript Debugging for ASP.NET (Chrome and IE).

VS2017 Disable JS Debugging

This is a known issue already, and seems to have an investigation underway.

Full information about JS debugging in VS 2017 here:https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/


Today I got this error, and I just did a small workaround which was too simple.

  1. Close all of your chrome instances, that you might have opened before you opened Visual Studio.
  2. Now stop debugging and run your application again.

You will not get the error again and if the debugger doesn't hit, refresh the browser again.

Update (12-Dec-2018):

I just tested this bug in Visual Studio 2019 preview, it seems like the bug is fixed now.

Hope this helps.


I had the same problem after the most recent VS 2017 update (released March 14, 2017: build 26228.09). My program would debug fine in IE but would bomb out in Chrome. Killing all instances of Chrome within the Windows command line fixed the problem for me.

taskkill /im chrome.exe /f

I was then able to debug in Chrome.