By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,664 Members | 1,592 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,664 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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

Nov 15 '05 #2

P: n/a
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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


Nov 15 '05 #3

P: n/a
Is the PDB file in the same directory as the dll when IE loads it? Where
does it load it from?

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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



Nov 15 '05 #4

P: n/a
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

"Dave" <no****************@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Is the PDB file in the same directory as the dll when IE loads it? Where
does it load it from?

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 15 '05 #5

P: n/a
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)

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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



Nov 15 '05 #6

P: n/a
Copy the pdb files to the same directory the assembly is located at in the
GAC

"Marco Liedekerken" <no****@hotmail.com> wrote in message
news:uD*************@TK2MSFTNGP12.phx.gbl...
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)

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
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

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 15 '05 #7

P: n/a
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

"Dave" <no****************@wi.rr.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
Copy the pdb files to the same directory the assembly is located at in the
GAC

"Marco Liedekerken" <no****@hotmail.com> wrote in message
news:uD*************@TK2MSFTNGP12.phx.gbl...
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)

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
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
"Chris Capel" <ao**@nothing.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
> 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
>
> "Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
> news:uW**************@TK2MSFTNGP12.phx.gbl...
> > 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
> >
> >
>
>



Nov 15 '05 #8

P: n/a
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.
"Marco Liedekerken" <no****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

"Dave" <no****************@wi.rr.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
Copy the pdb files to the same directory the assembly is located at in the
GAC

"Marco Liedekerken" <no****@hotmail.com> wrote in message
news:uD*************@TK2MSFTNGP12.phx.gbl...
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)

"Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
news:OV**************@TK2MSFTNGP11.phx.gbl...
> 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
>
>
> "Chris Capel" <ao**@nothing.com> wrote in message
> news:%2******************@TK2MSFTNGP09.phx.gbl...
> > 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
> >
> > "Arun Bhalla" <bh****@arun.groogroo.com> wrote in message
> > news:uW**************@TK2MSFTNGP12.phx.gbl...
> > > 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
> > >
> > >
> >
> >
>
>



Nov 15 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.