在重新安装Visual Studio 2017后,我试图运行.NET核心Web项目,当我试图在Chrome上运行它时,我得到这个错误:
无法启动程序,当前操作不合法 状态
在重新安装Visual Studio 2017后,我试图运行.NET核心Web项目,当我试图在Chrome上运行它时,我得到这个错误:
无法启动程序,当前操作不合法 状态
当前回答
我试着用Sibeesh Venu的答案,但对我没用。我相信,如果我杀死了所有的铬进程,它会起作用。我完成了一些其他测试,发现在Chrome设置中关闭“继续您离开的地方”可以确保这种情况不会再次发生。
其他回答
如果你不能用任何其他方式解决这个问题,那么试试这个(它对我很有效!):
将下面的代码保存到您的web配置文件中,然后重命名value="yourwebformname.aspx"
<system.webServer>
<defaultDocument>
<files>
<add value="insertion.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
其他的尝试:
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
对我来说,问题是在调试Chrome窗口上登录我的谷歌帐户。在我注册之前,这对我来说工作得很好。一旦我退出了那个Chrome实例,并选择通过复选框删除我的所有设置,调试器又正常工作了。
我的非调试Chrome实例仍然登录到谷歌和不受影响。主要的问题是我可爱的插件从调试版本中消失了,但至少我可以再次逐步检查客户端代码。
启用JavaScript调试的解决方案
在Chrome浏览器中,进入:设置>高级>系统 并禁用“当谷歌Chrome浏览器关闭时继续运行后台应用程序”。 重要!上面的选项必须为正确的Chrome用户配置文件设置! Visual Studio有自己的Chrome用户配置文件,当你使用“正常”Chrome浏览器时设置的首选项不会对从VS启动的Chrome浏览器产生任何影响(启用JS调试)。
Run your project from VS with "Enable JavaScript debugging..." enabled. The Chrome browser should open and you'll get the error in VS. Go back to the same instance of Chrome that VS started and disable "Continue running background apps when Google Chrome is closed" as explained above. If you don't have "Enable JavaScript debugging..." enabled/checked, the Chrome instance would use your Default User Profile and the error would persist. Stop and rerun your project, Chrome should load the project as expected without any errors and with JS debugging enabled.
当你停止调试时,你必须关闭由VS启动的Chrome实例,否则错误将在下次运行项目时返回。如果有其他Chrome实例,你可以让它们打开。
要确保Chrome使用正确的用户配置文件,请在url栏中输入Chrome://version/,然后查看配置文件路径的值。在Windows上,正确的值应该是这样的: “C: \ \用户【用户名】微软\ AppData \当地\ \ VisualStudio \ 15。* * \ \ WebTools \ ChromeUserData_默认”
如果Chrome使用浏览器默认设置,或者如果你用一个帐户登录Chrome,它将看起来像这样: “C:\Users\[UserName]\AppData\Local\谷歌\Chrome\User Data\[ProfileName] OR Default”
奖金。如果你在调试时使用Chrome扩展,这些必须在VS配置文件激活时安装。
3个选项
关闭“Tools > Options > Debugging > General”中的JavaScript调试功能 杀死所有chrome任务 切换到另一个浏览器进行调试
我最近犯了这个错误。对我来说,解决它的方法是关闭一扇运行检查器的铬窗。我让它弹出自己的窗口,每当我检查一个网页。不需要禁用或改变visual studio上的任何东西。