Monday, March 26, 2012

object reference not set to an instance of an object

I'm getting the following error:

Object reference not set to an instance of an object.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

I have trace on, but still I'm having trouble detereming what exactly is wrong. Is there anything else you could recommend trying to do? I'm using a dll that was created by a former co-worker and I'm not exactly sure how it works, but trying to figure it out. Thanks

There are several reasons for this. But we are going to need more information. Could you narrow it down to at least where this is happening and posting the code?


If your having trouble finding it, make sure the dll is compiled in debug mode. Also you may want to enable breaking on all exceptions: In the debug menu select 'Exceptions' and check all the boxes under 'Thrown' then click ok and try debugging again. This way if the error is trapped, you'll still break on the line that through the exception.


Why not step through the code to see exactly where it's kicking out. This is a general error that occurs when an object is trying to be referenced that has not been instantiated. Like the other posters eluded to, this can happen in many places. Put some code up for more help.


try to use a breakpoints and see at which line exception is being threw and we can check the line.

0 comments:

Post a Comment