本文翻译自:Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state

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: 在全新安装Visual Studio 2017之后,我尝试运行.NET Core Web项目,当我尝试在Chrome上运行它时,我收到此错误:

Unable to start program, An operation is not legal in the current state 无法启动程序,在当前状态下操作不合法


#1楼

参考:https://stackoom.com/question/2t8GG/Visual-Studio-错误-无法启动程序-在当前状态下操作不合法


#2楼

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... . 选择Chrome作为浏览器后,单击“ Debug菜单并选择“ Attach to Process...

In the subsequent dialog, select Chrome.exe in the list and click the Select button for Attach to: . 在随后的对话框中,选择Chrome.exe中的Chrome.exe ,然后单击“ Attach to:的“ Select按钮。 Tick the Native box, then Attach (or just double-click Chrome.exe ): 勾选Native框,然后选择Attach (或只需双击Chrome.exe ):

This starts the project running without launching the browser. 这样可以在不启动浏览器的情况下启动项目。 Stop and restart in Chrome and the error is gone. 在Chrome中停止并重新启动,错误消失了。

Of course, another potential solution is to use a different browser but I like debugging in Chrome. 当然,另一个潜在的解决方案是使用不同的浏览器,但我喜欢在Chrome中进行调试。 :-) :-)


#3楼

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. 关闭在打开Visual Studio之前可能已打开的所有chrome实例。
  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): 更新(201年12月12日):

I just tested this bug in Visual Studio 2019 preview, it seems like the bug is fixed now. 我刚刚在Visual Studio 2019预览中测试了这个错误,好像现在修复了这个bug。

Hope this helps. 希望这可以帮助。


#4楼

For me, the solution (workaround) is to turn off JavaScript debugging on Chrome, which I believe is a new feature introduced in VS 2017. 对我来说,解决方案(解决方法)是关闭Chrome上的JavaScript调试,我认为这是VS 2017中引入的新功能。

Go to Tools > Options > Debugging > General and turn off the setting for Enable JavaScript Debugging for ASP.NET (Chrome and IE) . 转到工具>选项>调试>常规 ,然后关闭启用ASP.NET的JavaScript调试(Chrome和IE)的设置

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/ 有关JS 2017中JS调试的完整信息,请访问: https : //blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/


#5楼

I had the same problem after the most recent VS 2017 update (released March 14, 2017: build 26228.09). 在最近的VS 2017更新(2017年3月14日发布:build 26228.09)之后,我遇到了同样的问题。 My program would debug fine in IE but would bomb out in Chrome. 我的程序将在IE中调试正常,但会在Chrome中爆炸。 Killing all instances of Chrome within the Windows command line fixed the problem for me. 在Windows命令行中杀死所有Chrome实例可以解决我的问题。

taskkill /im chrome.exe /f

I was then able to debug in Chrome. 然后我就可以在Chrome中调试了。


#6楼

I think that this happens when javascript debugging is enabled in visual studio and at the same time the chrome developer tools debugger is enabled. 我认为在Visual Studio中启用javascript调试并且同时启用了chrome开发人员工具调试器时会发生这种情况。 The problem arises because two different debuggers trying to debug the same process. 问题出现是因为两个不同的调试器试图调试相同的进程。

Visual Studio 2017错误:无法启动程序,在当前状态下操作不合法相关推荐

  1. 如何用 Visual Studio 2017 开发 Arduino 应用程序

    如何用 Visual Studio 2017 开发 Arduino 应用程序 使用Visual Studio 2017 开发 Arduino 应用程序需要两个软件: Visual Studio Vis ...

  2. visual studio 2015安装 无法启动程序,因为计算机丢失D3DCOMPILER_47.dll 的解决方法

    对于题目中的解决方法,我查到了微软提供的一个方案:https://support.microsoft.com/en-us/help/4019990/update-for-the-d3dcompiler ...

  3. 【微软Visual Studio面世20周年巨制】全宇宙功能最强大IDE Visual Studio 2017 正式版发布

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...

  4. 最强 IDE Visual Studio 2017 正式版发布-gt;最快更高效-终于等到你

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...

  5. 终于等到你,最强 IDE Visual Studio 2017 正式版发布(附详细介绍与下载地址)

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...

  6. Visual Studio 2017 正式版发布

    最强 IDE Visual Studio 2017 正式版发布 Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进 ...

  7. 最强 IDE,Visual Studio 2017 正式版发布

    (点击上方蓝字,可快速关注我们) 来源:开源中国 https://www.oschina.net/news/82641/ Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试 ...

  8. 终于等到你,最强 IDE Visual Studio 2017 正式版发布

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...

  9. Visual Studio 2017 安装及使用(新手)

    Visual Studio 2017 一:下载: 官网下载即可 官网地址:https://visualstudio.microsoft.com/ 进入后第一个Visual Studio IDE 点击第 ...

最新文章

  1. 关于IIS正在使用突然断电后,IIS不能使用解决方案
  2. Django (auth模块、User对象、用户认证、线上-用户认证)
  3. 【GAN优化】最早被用于评价GAN模型的定量指标Inception Score是什么
  4. python五种调试或排错的方法
  5. 代码编写工具_我希望在开始编写代码时就已经知道的工具:已复习
  6. 第5讲++创建管理数据库
  7. linux 不知道root密码怎么办,linux下忘记root密码怎么办
  8. linux操作指令训练,实验二linux 常用命令练习
  9. 如何仅对文档项目在ECB中应用自定义操作
  10. Linux 网卡流量查看
  11. mswinsck.ocx 一个文件丢失或无效_AutoCAD文件修复的10种方法
  12. PHP array(递归)转xml,xml转array
  13. Windows中使用Netsh Winsock Reset命令解决网络连接问题
  14. 废柴日记之中秋特辑:那些年我们一直分不清楚的近义词们①
  15. 连续状态空间模型离散化
  16. 修改app的名字和图标
  17. Excel游戏—制作数字炸弹小游戏
  18. 2035年进入现代化交通强国行列
  19. FlinkSQL字段血缘解决方案及源码
  20. 初识mysql实验小结_初识mysql学习笔记

热门文章

  1. Android4.0 Design之UI设计易犯的错误1
  2. Arrays.asList方法总结
  3. linux 读书笔记
  4. c++ 以模板类作为参数的模板
  5. 经过研究发现。c++里面的const意思是说,我是const,成员也是const!!!
  6. Android 水波效果 | 涟漪效果 实现
  7. 大家都说 Java 反射效率低,为什么呢?
  8. LFU的多种实现方式,从简单到复杂,新手必看
  9. win10装centos双系统之后,win10的启动项消失的解决方法
  10. java executor_Java 动态语言支持