Sunday, June 30, 2013

Visual Studio throws an exception: "Object reference not set to an instance of an object."

There are many places in your code which can throw the null reference exception. Which is the line that is causing the issue?


When an exception is thrown, Visual Studio will break at the problematic line. You can hover over objects involved in that line and see any one is null (first one from left). And then check why it is null.


I hope this helps.




Please mark this post as answer if it solved your problem. Happy Programming!


No comments:

Post a Comment