I have a Asp.net-C# Web app, with 4-5 associated projects all written in c#. I’m using .net 3.5.
My problem is, when I try running my application from the solution, it shows an error:
“Error 17 Object reference not set to an instance of an object”
When I build/rebuild the solution, it will be gone. When I click the error it takes me no where. And another interesting thing is, there is no location specified for the error.
Please help.
The error means that some object is null, and you try to call a method or access a property on it.
For example this code will give the same error message:
If you can’t find out where, and for some reason don’t have any stack trace, try adding a try/catch block around the code you think is suspicious and see if the error is there or not.
Another solution is to just add a breakpoint, and go through your code line by line untill it explodes.
Without more details, that is the best advice I can give you.