Quote Originally Posted by nycdev View Post
The issue is likely related to your development environment. I believe by default your development environment expects YOU to handle certain exceptions, Null Reference being one of them.

To fix, in VS 2008 (Similar for other versions of VS) go to:

(On the toolbar) Debug > Exceptions (Or CTRL + ALT + E)

This brings up a list of all exceptions and how they're handled.

Navigate the Tree List to:

Common Runtime Exceptions > System > System.NullReferenceException

Check the checkbox that says "THROWN". Click OK and run the program via Debug Mode. The program should now throw that same exception and you'll see exactly what's going on.

Enjoy

P.S. This happened to me 2 days ago ;-).
tried that, also selected THROWN for all system exceptions. still same thing. works in debug, no errors, after i build, double click on exe in the bin/release folder and the error is shown, if i press continue it works fine...

Code:
Object reference not set to an instance of an object