Re: NullReferenceException Message Feature Request

From: Bryan Livingston (anonymous_at_discussions.microsoft.com)
Date: 02/21/04


Date: Sat, 21 Feb 2004 11:06:05 -0800

The exception only happens on a production website and only occours about once every three days. I havn't been able to reproduce it in a debug environment.

Since we are doing financial transactions on the site I don't exactly have time to *** around with attaching a debugger. I have to get the site back up right away.

Bryan
     
     ----- Stu Smith wrote: -----
     
     Please tell me you have exceptions set to 'break' in the debugger.... if you
     do, it's usually absolutely obvious what the null reference should have
     been.
     
     "Bryan Livingston" <anonymous@discussions.microsoft.com> wrote in message
     news:6FDA50BD-7BF4-43C6-AD92-6DE18207002C@microsoft.com...
> I'm guessing that NullReferenceExceptions are by far the most common
     exceptions thrown in .net.
>> Why not add the type of the reference to the message? Have it say
     something like:
> Object reference of type 'string' not set to an instance of an object.
>> This would really help when trying to figure out where the null reference
     is happening.
>> I've just spent the last two days finding a null reference that happens
     very intermittently. Having the type would have saved me many hours.
>> In addition to just the type, you might be able to use reflection to give
     a property name or variable name.
>> Bryan Livingston
> Alphora.com