Re: code within libraries vs code within same project
From: melinda (melinda_at_discussions.microsoft.com)
Date: 02/25/05
- Next message: Edgardo Rossetto: "Re: Data Records from Flat File (COBOL Style)"
- Previous message: Edgardo Rossetto: "Re: Getting web page text from HTML"
- In reply to: Ignacio Machin \( .NET/ C# MVP \): "Re: code within libraries vs code within same project"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 10:43:03 -0800
sorry for so many posts, but I still have one question....
Is this a bug in System.Diagnostics.StackTrace?
I call
System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(2, true);
//at this point st.FrameCount is 4, although only 3 have filenames (All
frames that
//appear that are part of the .exe display properly, but the one's that are
part of
//the .dll do not appear to have all the info, particularly filename.
System.Diagnostics.StackFrame sf = st.GetFrame(0);
//now sf is the one without a filename, it's null, it happens to be the
first frame that is part of the dll.
sf.GetFileName(); // this throws an exception, becasue filename is null.
First off, why is filename not there? I'm building with debug on and not
optimized.
Second off, why is filename null? This seems like a bug, but I'm not an
expert on what's considered a bug.
"Ignacio Machin ( .NET/ C# MVP )" wrote:
> Hi,
>
> I bet your problem has nothing to do with the fact the type is in a dll,
> most probably it's cause you are using some resource particular to the .exe
> that is not accesible to the dll.
> Are you using any Environment, AppSetting or something like that?
>
> Take a look at the null object , in the Exception.StackTrace you will get
> the line number of the error.
>
> if this do not help just post the code
>
> cheers,
>
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
> "melinda" <melinda@discussions.microsoft.com> wrote in message
> news:D7A96F15-5954-47AC-B86E-FD21854C1FB1@microsoft.com...
> > What are some possible reasons for this:
> >
> > I call a static method from a class within my assembly...works fine.
> > I call the same static method after it has been compiled into a different
> > assembly and referenced to my project....does't work. Give's me a
> > "Object
> > not set to an instance...".
> >
> > What are some possible reasons for this? I'm just giving the assembly a
> > strong name, compiling it into a dll and adding it as a reference into my
> > project. Why would this work any differently?
>
>
>
- Next message: Edgardo Rossetto: "Re: Data Records from Flat File (COBOL Style)"
- Previous message: Edgardo Rossetto: "Re: Getting web page text from HTML"
- In reply to: Ignacio Machin \( .NET/ C# MVP \): "Re: code within libraries vs code within same project"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|