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

前端 未结 20 2176
醉话见心
醉话见心 2020-12-12 08:43

After fresh installation of Visual Studio 2017 I tried to run .NET Core Web project and when trying to run it on Chrome I am getting this error:

Unabl

相关标签:
20条回答
  • 2020-12-12 09:10

    I found a workaround to this which worked for me.

    With Chrome selected as your browser, click the Debug menu and select Attach to Process....

    In the subsequent dialog, select Chrome.exe in the list and click the Select button for Attach to:. Tick the Native box, then Attach (or just double-click Chrome.exe):

    This starts the project running without launching the browser. Stop and restart in Chrome and the error is gone.

    Of course, another potential solution is to use a different browser but I like debugging in Chrome. :-)

    0 讨论(0)
  • For me the issue was signing into my Google account on the debug Chrome window. This had been working fine for me until I signed in. Once I signed out of that instance of Chrome AND choose to delete all of my settings via the checkbox, the debugger worked fine again.

    My non-debugging instance of Chrome was still signed into Google and unaffected. The main issue is that my lovely plugins are gone from the debug version, but at least I can step through client code again.

    0 讨论(0)
  • 2020-12-12 09:14

    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.

    0 讨论(0)
  • 2020-12-12 09:16

    Either switch your browser in VS2017. Or open up a command prompt as administrator and do a tskill chrome about 10 times to make sure the app fully dies. Then try again. Sometimes it gets stuck on another process and even it needs to be restarted.

    0 讨论(0)
  • 2020-12-12 09:16

    Another solution you can try that worked for me when I received this error is to clean the solution, then do a rebuild. As the other solutions did not help me, I thought this might help someone else in the same boat.

    0 讨论(0)
  • 2020-12-12 09:18

    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.

    0 讨论(0)
提交回复
热议问题