Object reference not set to an instance of an object - how to find the offending object name in the
- by Jason
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.