How do I log an exception with a full call stack?

When the app is compiled without debug flags, the stack is not necessarily preserved in execution. You can only guarantee each item being recorded by adding try / catch to every method.

– Alex Oct 11 '10 at 12:03 Yes, I think it is inlining. Try / catch will get around it, or always building in debug mode. – cjk Oct 11 '10 at 12:44 @Alex: he means that the compiler (and the JIT) often optimizes your code by inlining methods (though you can prevent this using the MethodImplAttribute); in this case you won't get a complete stack trace.

– ShdNx Oct 11 '10 at 12:44 I have debug info set to pdb-only when in release mode. I have no idea if the compiler marks inlined methods in some way that it can be unravelled/fully debugged - it sounds possible.. Anyway, the question is still relevant for full debug versions where the full calling stack is definitely available. Any further help much appreciated.

Thanks guys – Alex Oct 11 '10 at 12:59 PS. You're absolutely right, I've just been reading up about code being inlined when compiled as optimised (non-debug, release mode) and it not showing in the call stack. So its use would be clearly limiting.

Thanks again – Alex Oct 11 '10 at 13:35.

It includes a stack trace. Does it include the kind that you're looking for?

Ex. StackTrace is a string representation of the current (inner) call stack, however it doesn't show me the stack outside the exception. I'll update the question body with the results of ex.

StackTrace and what I'm after – Alex Oct 11 '10 at 13:07.

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