Why doesn't NullReferenceException contain information about what is null?

前端 未结 6 755
情书的邮戳
情书的邮戳 2020-12-04 16:38

What was the design decision behind NullReferenceException not containing any runtime specific information except base class data (like a stacktrace)? And is there an extens

6条回答
  •  时光说笑
    2020-12-04 16:54

    If you have debug symbols, you can track down the line that caused the exception. If it's simple enough, you'll be straight getting your null value. Otherwise (think about a.Value = b.Do(c.GetX(),d.GetY(z.ToString()));) you must debug with your IDE

提交回复
热议问题