Detecting what the target object is when NullReferenceException is thrown

后端 未结 10 810
时光说笑
时光说笑 2020-12-03 01:18

I\'m sure we all have received the wonderfully vague \"Object reference not set to instance of an Object\" exception at some time or another. Identifying the object that is

10条回答
  •  自闭症患者
    2020-12-03 01:48

    you can check the Message and InnerException properties

    http://msdn.microsoft.com/en-us/library/system.exception.innerexception.aspx

提交回复
热议问题