System.NullReferenceException Not Being Caught in First Try/Catch Block?

It doesn't bypass anything. Look closely at your stack trace. Use Console.

WriteLine(ex.ToString()) You'll see that the exception is not being thrown from where you thought it was.

It doesn't bypass anything. Look closely at your stack trace. Use Console.

WriteLine(ex.ToString());. You'll see that the exception is not being thrown from where you thought it was.

Thanks for the feedback Jon. Could you expand on your point a little? The stack trace identifies EventGetLatestEventInfo() as the source of the exception.

– rgeorge Nov 24 '10 at 22:11 The source of the exception is inside of EventGetLatestEventInfo(), where you do not have a try/catch block. – John Saunders Nov 24 '10 at 23:03 Correct. So my expectation was that the exception would bubble up to the calling code, which is in a try/catch block?

– rgeorge Nov 24 '10 at 23:59.

This simply isn't the case and here's the proof: class Program { static void Main() { // no need of try/catch here as exceptions won't propagate to here Looper(); } static void Looper() { int processedRecords = 0; for (int I = 0; I.

It doesn't bypass anything. Look closely at your stack trace. Use Console.

WriteLine(ex.ToString()) . You'll see that the exception is not being thrown from where you thought it was.

This simply isn't the case and here's the proof.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions