Object reference not set to an instance of an object - how to find the offending object name in the

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-04-16T21:50:03Z Indexed on 2010/04/16 21:53 UTC
Read the original article Hit count: 248

Filed under:
|

This is the bane of my programming existence. After deploying an application, when this error crops up, no amount of debug dump tells you WHAT object was not instantiated. I have the call stack, that's great, it tells me roughly where the object is, but is there any way to get .NET to tell me the actual name of the object?

If you catch them while debugging, of course the program breaks right on the offending creature, but if it happens after the program is in the wild, good luck.

There has to be a way.

I've explored the exceptions returned in these instances and there is just nothing helpful.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET