ASP.NET MVC5/IIS Express 无法调试 - 代码未运行 [英] ASP.NET MVC5/IIS Express unable to debug - Code Not Running

查看:15
本文介绍了ASP.NET MVC5/IIS Express 无法调试 - 代码未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了一个 VS2013 VB.Net MVC5 Web 应用程序,在 HomeController About 方法中设置断点并运行Start Debugging",导航到 About 页面并收到消息 Code not running - The current Thread is not current正在运行或无法获取调用堆栈" 阻止任何调试.

I start a VS2013 VB.Net MVC5 Web Application, set a breakpoint in HomeController About method and run "Start Debugging", navigate to About page and receive the message "Code not running - The current Thread is not currently running or the call stack could not be obtained" preventing any debugging.

如果我在 Global.asax Application_Start 中设置断点,断点就可以正常工作.更改启用编辑并继续"没有任何区别.

If I set a breakpoint in Global.asax Application_Start, the breakpoint works fine. Changing the "Enable Edit & Continue" makes no difference.

有人知道发生了什么吗?

Anyone have any ideas what is happening?

更新:我的环境是带有 VS2013 Ultimate 的 Windows 8.0 Pro.

Update: My environment was Windows 8.0 Pro with VS2013 Ultimate.

此后我刷新了系统并全新安装了 Windows 8.1 Pro、VS2010 Ultimate、VS2012 Ultimate 和VS2013 终极版.

I have since flushed my system and done a completely fresh install of Windows 8.1 Pro, VS2010 Ultimate, VS2012 Ultimate, & VS2013 Ultimate.

对 VS 的所有 3 个版本都进行了相同的测试 - 文件 > 新建项目 > MVC(默认).VS 的所有 3 个版本都报告Id 为 xxx 的进程未运行."

Same test done on all 3 versions of VS - File > New Project > MVC (Default). All 3 versions of VS are reporting "Process with an Id of xxx is not running."

VS2013 调试跟踪报告 程序 '[7720] iisexpress.exe: Program Trace' 已退出,代码为 0 (0x0).程序 '[xxxx] iisexpress.exe' 已退出,代码为 -1073741816 (0xc0000008) '指定的句柄无效'."

VS2013 debug trace reports "The program '[7720] iisexpress.exe: Program Trace' has exited with code 0 (0x0). The program '[xxxx] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'."

我已经在管理员模式下运行 VS 并收到相同的结果.我已经卸载并重新安装了 IIS Express 8.0.

I have run VS in and out of Administrator mode and receive the same results. I have uninstalled and reinstalled IIS Express 8.0.

推荐答案

上述问题的解决方案很简单.关闭开发环境,转到 Documents 文件夹并重命名 IISExpress.现在设置环境变量 _CSRUN_DISABLE_WORKAROUNDS ( ref: http://gauravmantri.com/2013/02/05/workaround-for-iis-express-crashing-when-running-windows-azure-cloud-service-web-role-with-multiple-instances-in-windows-azure-sdk-1-8-compute-emulator/).

The solution to the above problem was a simple one. Close down dev environments, go to Documents folder and rename IISExpress. Now set environment variable _CSRUN_DISABLE_WORKAROUNDS ( ref: http://gauravmantri.com/2013/02/05/workaround-for-iis-express-crashing-when-running-windows-azure-cloud-service-web-role-with-multiple-instances-in-windows-azure-sdk-1-8-compute-emulator/ ).

现在重启PC,启动VS,加载网站并在调试中运行.IIS 自动重新生成了 IISExpress 文件夹,环境变量解决了冲突.

Now reboot PC, start VS, load website and run in debug. IIS automatically regenerated the IISExpress folder and the environment variable resolved conflicts.

这篇关于ASP.NET MVC5/IIS Express 无法调试 - 代码未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆