NullReferenceException Message Feature Request
From: Bryan Livingston (anonymous_at_discussions.microsoft.com)
Date: 02/18/04
- Next message: smith: "Which .NET Framework gets loaded?"
- Previous message: stack: "Re: What does the CLR do when you instantiate an object? - Continue"
- Next in thread: Stu Smith: "Re: NullReferenceException Message Feature Request"
- Reply: Stu Smith: "Re: NullReferenceException Message Feature Request"
- Reply: Bryan Livingston: "RE: NullReferenceException Message Feature Request"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Feb 2004 11:21:07 -0800
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
- Next message: smith: "Which .NET Framework gets loaded?"
- Previous message: stack: "Re: What does the CLR do when you instantiate an object? - Continue"
- Next in thread: Stu Smith: "Re: NullReferenceException Message Feature Request"
- Reply: Stu Smith: "Re: NullReferenceException Message Feature Request"
- Reply: Bryan Livingston: "RE: NullReferenceException Message Feature Request"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|