Detecting what the target object is when NullReferenceException is thrown

后端 未结 10 858
时光说笑
时光说笑 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:46

    Set VS to break on exceptions, then when you get your error it's usually pretty obvious what line it's on. The stack trace window will tell you how you got there. Not much else you can do apart from that.

提交回复
热议问题