Cri*_*scu 25 debugging breakpoints automatic-properties .net-3.5 visual-studio-2008
显然VS 2008不允许在自动属性的setter上设置断点.
即如果我定义这样的自动属性:
public int CurrentFramesize
{
get;
protected set;
}
Run Code Online (Sandbox Code Playgroud)
然后尝试在setter行上设置断点,整个auto-property变为breakpoint-red.
这适用于普通属性,所以任何想法为什么自动属性得到这种特殊(限制性)处理?它们不仅仅是具有隐藏背景场的正常属性的语法糖吗?
Mat*_*ith 29
使用Visual Studio 2008,2010,2012:
对于get,键入: ClassName.get_CurrentFramesize()
对于集合,键入: ClassName.set_CurrentFramesize(int)
当断点被击中时,你会得到一个"No Source Available",但是你将获得调用堆栈中的调用位置.
我在这里找到了这个解决方案:http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/b1dd0dc3-e9c1-402a-9c79-a5abf7f7286a
另请参阅:调试自动属性
| 归档时间: |
|
| 查看次数: |
4650 次 |
| 最近记录: |