单击“停止调试"后,其余代码将执行(VS 2010) [英] Remaining code executes once 'Stop debugging' clicked (VS 2010)

查看:142
本文介绍了单击“停止调试"后,其余代码将执行(VS 2010)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有趣的是,我目前正在逐步通过一个多项目应用程序,并在更新记录之前检查某些字段的有效性.满意后,一旦完成验证,我单击停止调试".但是快速检查一下SQL DB表示正在检查的记录也已更新,这意味着尽管尝试停止调试,其余代码仍已执行.

interesting one this, I am currently stepping through a multi project app and was checking the validation of some fields before an update of record. Once satisfied I clicked 'Stopped debugging' once validation was complete; however a quick check of the SQL DB indicated that the record being checked had also been updated meaning that the rest of the code was executed despite attempting to halt the debug.

我已经重播了几次,并且确保足够执行任何剩余的代码,而不管是否使用了停止调试.我没有使用任何特殊的附加到进程等-简单的默认调试选项.

I've replayed this a few times and sure enough any remaining code is executed irrespective if stop debugging is used. I am not using any special attach to process etc - simply the default debugging options.

任何帮助表示赞赏.

干杯

 

Mark

推荐答案

 

马克,

 

Hi Mark,

 

我不确定我是否清楚地了解了您的情况,但是 停止调试" 将允许应用程序继续运行(如果遵循以下代码)包含一些SQL命令,数据库记录肯定会更新.

I'm not sure I understand your scenario clearly, but 'Stopped debugging' will let the application continue to run, if following code contains some SQL commands, the database record surely will be updated.

 

或者,在停止调试之前,记录已更新?如果是这样,那么每次都可以重现吗?您可以发布一些相关的代码片段吗?如果您能指出哪个行代码将不胜感激 当您发现数据库记录已更新时,您会进入.

Or, the record was updated before you stop debugging? If so, is it reproducible each time? could you post some related code snippets? It will be appreciated if you could point out which line code you stepping into when you found that the database record has been updated.


这篇关于单击“停止调试"后,其余代码将执行(VS 2010)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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