Saturday, March 24, 2012

Object reference not set to an instance of an object - Slightly Strange Though

Hello there,

I have got a strange error in my code. I am getting a:

"Object reference not set to an instance of an object"

Error on line 39. But line 39 is commented out. Infact, I have commented out all of the
code in the file except the page load event, and I'm still getting an error on line 39!? But
line 39 is commented out!!

Has anyone here experienced something similar to this behaviour?

Cheers,
DaveDid you rebuild your project? If you did, try to delete the web cache, which is under:
Documents and Settings\YourUserName\VSWebCache\
I've found out why the error was occuring. The project was building the solution in the same directory as the aspx files and not in the bin directory. Therefore the program couldn't pick up the DLL and was erroring.

Cheers,
Dave.

0 comments:

Post a Comment