An unhandled exception of type 'System.StackOverflowException' occurred 解法

c#  An unhandled exception of type 'System.StackOverflowException' occurred in ClientPortal

最近发现的一个bug,找了一下,发现原来是property set bug,

      //硬盘大小总和

        public int Vm_TotalHardDisksQty       

{           

get { return vm_TotalHardDisksQty; }         

  set { Vm_TotalHardDisksQty = value;

}

Vm_TotalHardDisksQty to vm_TotalHardDisksQty,

不然引发异常,stackOverFlow,建议写成_TotalHardDisksQty  

仅仅一个字母,引发的问题,所以以后写property name     时,还是写好一点。

posted on 2011-03-30 11:13  SUNJUNLIN  阅读(2570)  评论(0编辑  收藏  举报

导航