VS 2015 Update 2-调试时不存在变量,为什么? [英] VS 2015 Update 2 - Variable does not exist when debugging, why?
问题描述
我正在将VS 2015 Update 2与配置为调试模式的asp.net 5 Web项目一起使用.当我使用F5运行项目以对其进行调试并达到断点时,即使在范围内,某些变量也无法在监视窗口中观察到.此外,如果将鼠标悬停在此类变量上,则不会显示任何值.
I'm using VS 2015 Update 2 with an asp.net 5 web project configured for debug mode. When I run the project with F5 to debug it and hit a break point, some variables can not be observed in the watch window even when they are in scope. Further, if I hover over such variables no value is displayed.
如果我使用同一Visual Studio创建一个空的Web项目并添加一个Webform并将代码放置在load方法中,则调试器可以正常工作.也就是说,我可以在监视窗口中看到变量,并且可以通过将它们悬停在变量上来查看它们的值.我从中得知,问题的根本原因不是VS2015 Update 2,而是与项目或解决方案配置有关,也许特定于asp.net 5 Web项目.
If I use the same visual studio to create an empty web project and add a webform and place the code in the load method, the debugger works fine. That is to say, I can see the variables in the watch window and I can see their values by hovering over them. I glean from this that the root cause of the issue is not VS2015 Update 2 but rather something to do with the project or solution configuration, perhaps specific to asp.net 5 web projects.
我已经在网上搜寻了答案,并且在尝试调试编译器优化的代码时也会发生类似的问题.但是我正在调试模式下运行该解决方案.有什么建议吗?
I've scoured the web for answers and similar problems happen when trying to debug compiler optimized code. But I am running the solution in debug mode. Any suggestions?
我知道变量在调试时的当前环境,但是它适用于其他版本的Visual Studio,那里提供的解决方案不能解决我的问题.
I am aware of Variable does not exist in the current context while debugging but it applies to a different version of visual studio and the solutions offered there do not fix my issue.
推荐答案
这是Visual Studio 2015 Update 2中引入的错误.本质上,调试器无法检查动态模块中的局部变量.我们今天为它发布了一个修补程序.您可以在此处下载补丁.修补程序的文档位于此处.让我知道补丁是否不能解决您的特定情况.
This is a bug that was introduced in Visual Studio 2015 Update 2. Essentially the debugger is unable to inspect local variables in dynamic modules. We released a hotfix for it today. You can download the patch here. Documentation for the patch is here. Let me know if the patch does not fix your particular scenario.
谢谢!
-帕特里克·纳尔逊(patrick Nelson)
-Patrick Nelson
这篇关于VS 2015 Update 2-调试时不存在变量,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!