Get an error when trying to start the exe

MrLucky

Freshman
Joined
Mar 5, 2006
Messages
47
Ok, this is really really strange:

When I press by debug button, My program starts under debug mode etc. Everything works fine.

But, when I go the myprojectfolder/bin/Debug and try to start the exe, I get an error! They ask if I want to send an report to microsoft etc.

This is the error signature:
EventType : clr20r3 P1 : ircbot.exe P2 : 1.0.0.0 P3 : 4411ee33
P4 : ircbot P5 : 1.0.0.0 P6 : 4411ee33 P7 : 39 P8 : c
P9 : system.nullreferenceexception

I can't do anything with this, except I know it's a system.nullreferenceexception

But where the problem is, I don't know..

Why am I getting this error when I try to start the application with the .exe, and not under debug mode?
 
How big is the program, and does the error occur right as you loud (before any form shows up) or at any other time?
 
It's a small program (I think in doesn't contain more than 1000 lines), and the error occurs before the form loads
 
MrLucky said:
It's a small program (I think in doesn't contain more than 1000 lines), and the error occurs before the form loads


I sugest puting debug message box in the first executable code, to see where exactly the error occur.

you can do it like that:

Instruction 1
messagebox("instruction 1 passed")
Instruction 2
messagebox("instruction 2 passed")


and etc until you can see exactly where it crash... not really fun to do but pretty usefull
 
Fixed it already, I had some code in my Form COnstructor, which I moved to the form_load event.

Then, when I started the program, I got a much more descriptive error message :)
 
Note that if the code is in your class, it's generally better to override OnLoad than use the Load event. Maybe I'm being nitpicky, but thought I'd mention it since many people don't know about OnLoad.

-ner
 
Back
Top