调试自动属性 [英] Debugging automatic properties

查看:93
本文介绍了调试自动属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来设置的setter /吸气断点自动实现的属性?

Is there any way to set breakpoint on setter/getter in auto-implemented property?

int Counter { get; set; }

除了将其更改为标准的属性(我做的这种方式,但要做到这一点我必须要改变和重新编译整个项目)

Other than changing it to standard property (I'm doing it in this way, but to do that I have to change and recompile whole project)

推荐答案

使用Visual Studio 2008,2010,2012,2013:

Using Visual Studio 2008, 2010, 2012, 2013:


  1. 转至断点窗口

  2. 新建 - >歇在功能...

  3. 对于GET,键入: ClassName.get_Counter()

有关的设置,键入: ClassName.set_Counter(INT)

您会得到一个没有源代码可用的时候,断点被命中,但你会得到调用堆栈调用位置。

You'll get a "No Source Available" when the breakpoint is hit, but you'll get the calling location in the call stack.

我在这里找到这个解决方案:<一href=\"http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/b1dd0dc3-e9c1-402a-9c79-a5abf7f7286a\">http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/b1dd0dc3-e9c1-402a-9c79-a5abf7f7286a

I found this solution here: http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/b1dd0dc3-e9c1-402a-9c79-a5abf7f7286a

这篇关于调试自动属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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