Thursday, 15 September 2011

c# - Get line number of first-chance exception -



c# - Get line number of first-chance exception -

i'm getting exceptions thrown somewhere, compiler "a first chance exception of type 'system.argumentoutofrangeexception' occurred in mscorlib.dll". useless me, that's not code (pretty sure it's default library). i'd see stack-trace or know in code things went wrong. it's big codebase (much of not mine), , there's lot of multi-threading , other stuff going on, it's impossible seek , step through code without thought of start looking. there setting somewhere create exceptions trigger break can see call-stack when occur, rather having them silently fail useless error message in output?

you have couple of options. first, greg said, can cause vs break when exception occurs:

make sure these checked, click ok:

that cause visual studio break wherever exception occurs.

another approach grab exception , either write stack trace, or write exception (using tostring()) output window:

then check output window:

c# debugging exception stack-trace

No comments:

Post a Comment