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     时,还是写好一点。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-06-16
  • 2021-08-19
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2022-03-04
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案