VS RC 2012调试器无法识别“等待"结果的结果.称呼 [英] VS RC 2012 Debugger not recognizing result of result from "await" call

查看:76
本文介绍了VS RC 2012调试器无法识别“等待"结果的结果.称呼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序大量使用了新的TAP/异步东西.我有几个GUI事件处理程序,其最后一行以对"await"的方法的调用结尾,如下所示:

I have an app that uses the new TAP/async stuff pretty heavily. I have several GUI event handlers whose last line ends in a call to a method with "await", like this:

String s = await MyTaskReturningFunction(...)

我的问题是使用调试器检查"s"时经常遇到麻烦.这是我尝试过的:

My problem is that I'm frequently having trouble using the debugger to examine "s". Here's what I've tried:

如果上面的语句是该方法的最后一行,则在该方法的右括号处放置一个断点.当调试器在此停止时,"s"将停止.不能被调试器识别(但是其他局部变量可以识别)

If the above statement is the last line in the method, I put a breakpoint on the closing brace of the method. When the debugger stops there, "s" is not recognized by the debugger (but other local variables are)

我可以添加一个占位符"上一行之后的代码行,例如"Int32 j = 5".并为此设置一个断点.有时,当我运行代码时,断点会神秘地向下推到下一行代码(有时进入下一个方法!),或者,如果 我很幸运,调试器确实在"j = 5","s"处停止.无法被调试器识别.

I can add a "placeholder" line of code after the above line, like "Int32 j = 5" and put a breakpoint on this. Sometimes, when I run the code, the breakpoint gets mysteriously pushed down to the next line of code (sometimes into the next method!), or, if I get lucky and the debugger does stop on "j = 5", "s" is not recognized by the debugger.

这种情况并非总是会发生,但在此应用程序中经常发生.

This does not always happen but it happens frequently with this application.

这是一个已知的问题,并且/或者有什么我可以检查的内容来弄清这个问题的根源吗?

Is this a know problem and/or are there things I could check to get to the bottom of this?

谢谢

迈克尔

推荐答案

迈克尔,

感谢您访问MSDN论坛.

Thank you for visiting the MSDN forum.

字符串s =等待MyTaskReturningFunction(...)

您是不是在将断点添加到上面的行代码中时未命中断点?

Do you mean that the breakpoint isn’t hit when you add it to the above line code?

    • 如果您的应用未使用该代码,则会产生此问题,因此,如果删除此行代码,您的应用是否运行良好?如果正常运作,恐怕未使用此行代码.
    • 如果在删除此行代码时生成了错误.像这样的常见问题"我如何解决断点没命中"问题?"
    • If the code isn’t used by your app, it will generate this issue, so if you remove this line code, does your app work well? If it worked normally, I’m afraid that this line code isn’t used.
    • If it generated the error when you remove this line code. Like this FAQ "How do I troubleshoot "the breakpoint was not hit" issue?"

(1).确保正确下载和安装了最新的SP/修补程序

(2).以下项目已正确配置
在ASP.NET项目中,检查了ASP.NET调试器
在SQL Server项目中,允许对数据连接进行SQL/CLR调试
在Silverlight项目中,已检查Silverlight调试器

(2). The following project are configured correctly
in ASP.NET project, ASP.NET debugger is checked
in SQL Server project, SQL/CLR Debugging is allowed on the data connection
in Silverlight project, Silverlight debugger is checked

(3).确保Visual Studio处于调试模式,因为未优化调试模式下的代码

(4).打开进程"窗口(调试"->"Windows"->进程"),确保当前的调试类型是预期的类型

如果我有任何误解,请随时让我知道.

If I have misunderstood anything, please make free feel to let me know.

最好的问候


这篇关于VS RC 2012调试器无法识别“等待"结果的结果.称呼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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