Re: StackTrace and StackFrame

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marina (someone_at_nospam.com)
Date: 03/12/04


Date: Fri, 12 Mar 2004 14:58:10 -0500

Was the code that is throwing the exception compiled in debug mode? Are the
debug symbols in the same directory?

"C# beginner" <anonymous@discussions.microsoft.com> wrote in message
news:91a001c4086b$0fcbe4c0$a601280a@phx.gbl...
> StackTrace Trace = new StackTrace(true);
> int Count = Trace.FrameCount;
> StackFrame Frame = Trace.GetFrame(0);
> String FileName = Frame.GetFileName();
> int LineNumber = Frame.GetFileLineNumber();
>
> Hi all
> I posted this question a few days back. I am trying the
> above code in my C# assembly. I get Count as 4. But no
> matter how I try, I can't get the correct filename and
> linenumber. They are always null and 0 respectively. Can
> anyone help me resolve this issue?
> I am using a debug build of my assembly.
> Thanks a lot in advance for your replies.



Relevant Pages

  • Re: CPtrArray Performance
    ... CPtrArray has approximately the same performance as an ordinary array. ... are you measuring debug or optimized code? ... can completely swamp the actual function execution. ... In debug mode, you worry about getting it right. ...
    (microsoft.public.vc.mfc)
  • Re: frame creation bug in release mode
    ... > I have a MDI MFC app which works well in debug mode. ... > after "Create", the app crashes. ...
    (microsoft.public.vc.mfc)
  • Re: /MT and /MD
    ... then the codepath may differ in Debug vs. Release builds. ... In Debug mode, it may not be zero." ...
    (microsoft.public.vc.language)
  • Re: Debug library crashes when linked with Release build
    ... In debug mode the classes ... compiled the classes memory footprint is smaller thanm in debug mode ... compiler or library implementation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Execution time debug vs. release
    ... Note that VS is doing more and more runtime checks in debug mode, ... You could check this out by compiling just one of your files in VS7 and VS8 with the ... speed with Task Manager showing 0% CPU time. ...
    (microsoft.public.vc.mfc)