Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / February 2004

Tip: Looking for answers? Try searching our database.

C# exceptions not showing filename/line numbers (PDB issue?)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arun Bhalla - 02 Feb 2004 23:55 GMT
Hi,

I'm developing an Explorer bar using VS.NET 2003 (C#) on Windows XP.  For
some time, I've noticed that I don't have filenames and line numbers
appearing in my exceptions' stack traces.  On the other hand, debugging with
breakpoints, etc. seems to work fine in VS.NET 2003.  I can't understand why
this isn't working -- and I think it used to work, perhaps under VS.NET
2002, but maybe not.  The information doesn't appear in exceptions when
running under VS.NET or when not.

I am running my Explorer bar (which is a class library, not an application)
on the same machine (and user account) which built the library.  The PDB
file is accessible to me, and its location does match the location in the
assembly.  I am making Debug builds, and I do have "Generate debugging
information" enabled.  As far as I can tell, the PDB and DLL files are
equally fresh and the same version?

Any tips?  Is this a known bug?  It's driving me batty trying to locate an
exception in code blocks without any help from line numbers.

Thanks!
Arun
Chris Capel - 03 Feb 2004 03:32 GMT
Tell me this. When you run the project from Visual Studio, or attach to the
process after it's started, look in your Output tab for all the assembly
loading logs. Find the one for the assembly in question. See whether it says
"Symbols Loaded" or "No symbols loaded". The symbols in question are,
obviously, the debugging symbols. From your description, I suspect that it
is loading the debug symbols. Tell me if this is your situation: When
running the program by pressing F5 on your project, you encounter an
exception and the standard exception dialog appears with a stack trace but
no line numbers.

I do believe that whether or not you have a pdb, the only time you get line
numbers in your stack traces is when you're *actually debugging* the
project. Now, I could be wrong, but this is my experience.

Chris

> Hi,
>
[quoted text clipped - 18 lines]
> Thanks!
> Arun
Arun Bhalla - 03 Feb 2004 18:09 GMT
Thanks for responding...

When I hit F5 (Start), I do see that symbols are being loaded for the
assembly in question.  However, when an exception occurs in my assembly, I
don't see the line numbers in the MessageBox which I popup containing the
exceptions StackTrace, etc.  I hope it doesn't matter, but again I'm writing
an Explorer bar, which is a class library that gets loaded by Internet
Explorer.

I decided to try a new Windows Application solution.  I was able to throw
and catch an exception and display the line numbers in a MessageBox there.
It also didn't matter if I Started the project (F5) or Started without
debugging (Ctrl-F5).

Any ideas?

cheers,
Arun

> Tell me this. When you run the project from Visual Studio, or attach to the
> process after it's started, look in your Output tab for all the assembly
[quoted text clipped - 37 lines]
> > Thanks!
> > Arun
Dave - 04 Feb 2004 11:06 GMT
Is the PDB file in the same directory as the dll when IE loads it? Where
does it load it from?

> Thanks for responding...
>
[quoted text clipped - 62 lines]
> > > Thanks!
> > > Arun
Arun Bhalla - 04 Feb 2004 18:46 GMT
I figured out yesterday that the issue was that the DLL was in the GAC, and
the PDB path
in the DLL was relative (./).  When I copied the PDB file to the same
directory in the GAC,
it worked.

Thanks,
Arun

> Is the PDB file in the same directory as the dll when IE loads it? Where
> does it load it from?
[quoted text clipped - 74 lines]
> > > > Thanks!
> > > > Arun
Marco Liedekerken - 17 Feb 2004 10:49 GMT
Hi Arun,

I have the same problem as you have (had).
Did you find a solution for it allready or does anybody who reads this now
know how to solve it?

Thanks, Marco (puzzled)

> Thanks for responding...
>
[quoted text clipped - 62 lines]
> > > Thanks!
> > > Arun
Dave - 17 Feb 2004 11:18 GMT
Copy the pdb files to the same directory the assembly is located at in the
GAC

> Hi Arun,
>
[quoted text clipped - 79 lines]
> > > > Thanks!
> > > > Arun
Marco Liedekerken - 17 Feb 2004 13:35 GMT
Hi Dave,

This sounds good.

Only I get a build message that only assembly files (not pdb files) can be
shared in the GAC. I do the copying action via the Setup projects File
System on target machine, Global Assembly Cache folder.
I selected the pdb file I wanted to have in the GAC and set it into this
folder.

My Windows Service (.exe) assembly is installed to the folder "C:\Program
Files\NameCompany\MyServiceSetup"

Can you be a bit more specific on what I have to do?

Thanks, Marco

> Copy the pdb files to the same directory the assembly is located at in the
> GAC
[quoted text clipped - 93 lines]
> > > > > Thanks!
> > > > > Arun
Dave - 18 Feb 2004 01:16 GMT
I'm not sure how you would do this automatically. You don't want to share
the pdb file or to install it, you only want to copy it.

You can manually copy the pdb files to the GAC. There's a registry switch (I
don't recall which one but you should be able to google it up) that allows
you to turn off the standard explorer display of the GAC so that it shows up
as if it were a directory filled with folders. Locate the folder your DLL is
in and manually copy the pdb there.

> Hi Dave,
>
[quoted text clipped - 119 lines]
> > > > > > Thanks!
> > > > > > Arun

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.