General > Off Topic

.net crashing, no error help, any ideas?

<< < (2/2)

Botsareus:
ok, but:

What If I have 20 Complex lines of code and I have no idea which line is causing it.
Don't I have to wrap each line with this 'Try Catch' stuff?

P.S.

I am beginning to like C#, it is like a mesh of VB and C++, I think the first language I will learn in collage will be C++ and I already know VB so...

Numsgil:

--- Quote from: Botsareus ---ok, but:

What If I have 20 Complex lines of code and I have no idea which line is causing it.
Don't I have to wrap each line with this 'Try Catch' stuff?
--- End quote ---

No.  Part of the information in the exception is a full call stack.  So it not only tells you the line it's crashing on but also the full call stack so if the crash is inside some math function called from all over your code you can track down what was calling it on up the call stack.

See This member list of System.Exception.  You can call exception.Message to get a message describing the error.  You can also call exception.StackTrace for a stack trace.

Botsareus:
aha, TY

Navigation

[0] Message Index

[*] Previous page

Go to full version