Unable to debug DLL with PDB files

M

Martin Horst

Hi,

in VS 2003 I had no problem to debug into a dll with an existing pdb
file. In VS 2005 and also in VS 2008 I'm not able to debug into the
source code of the dll. If I try so an explorer window appears where I
have to choose the location of the source file. The pdb file lies inside
the debug output directory and belongs to the dll. I'm not sure if I
missed some settings or what else can be wrong.
Hope someone has an idea because attaching the project directly is not
possible (remoting issues).

Thanks in advance
Martin
 
S

shahkalpesh77

Martin,

I am making a guess here.
It could be that the target runtime your exe uses (2.0 or above) could
be different from the framework version you made build using (1.0 or
1.1)
or, the DLL could be latest (with code changes) & not in sync with
pdb.

MVPs can comment things more appropriately.

Kalpesh
 
M

Martin Horst

Hi,

Martin,

I am making a guess here.
It could be that the target runtime your exe uses (2.0 or above) could
be different from the framework version you made build using (1.0 or
1.1)
or, the DLL could be latest (with code changes) & not in sync with
pdb.

MVPs can comment things more appropriately.

Kalpesh

I had the guesses, too. The target runtime is the same, the pdb fit to
their dll, even the source code lies on the same disk location. I'm
really at a loss.

Thanks and greets
Martin
 
W

wilbain

Hi,






I had the guesses, too. The target runtime is the same, the pdb fit to
their dll, even the source code lies on the same disk location. I'm
really at a loss.

Thanks and greets
Martin

If you open up the Modules window of VS 2005 it tells shows you which
symbols are loaded and if they are not then it tells you why not.
 
M

Martin Horst

Hi,

If you open up the Modules window of VS 2005 it tells shows you which
symbols are loaded and if they are not then it tells you why not.

I you can tell where I can find the "modules window", that whould be
nice. Do you mean the object browser, because I can't find anything like
"module window".

Best regards
Martin
 
J

Jon Skeet [C# MVP]

I you can tell where I can find the "modules window", that whould be
nice. Do you mean the object browser, because I can't find anything like
"module window".

Debug > Windows > Modules

Look up "Modules window" in the MSDN index for more information.

Jon
 
M

Martin Horst

Hi,
Debug > Windows > Modules

Look up "Modules window" in the MSDN index for more information.

Jon

all right, found it (never used it before). As far as I can see the
corresponding pdb has be loaded. But if I try to step into the dll code
the following error message appears: "There is no source code available
for the current location.".
I think there is the problem because the dll has been build on a
different machine. I took a look inside the pdb file and I found the
directory of the source files. So I created the same directory on my
machine copied the source file into this directory. But this changed
anything. Maybe the filetime is importiert, I don't know.
I go and build the dll on my machine and see what's happening. Maybe
this is the problem.

Best regards
Martin
 
J

Jon Skeet [C# MVP]

all right, found it (never used it before). As far as I can see the
corresponding pdb has be loaded. But if I try to step into the dll code
the following error message appears: "There is no source code available
for the current location.".
I think there is the problem because the dll has been build on a
different machine. I took a look inside the pdb file and I found the
directory of the source files. So I created the same directory on my
machine copied the source file into this directory. But this changed
anything. Maybe the filetime is importiert, I don't know.
I go and build the dll on my machine and see what's happening. Maybe
this is the problem.

When you copied the source, did you copy the exact same version of the
source that created the DLL? I believe the PDB contains hashes of the
source so it can detect changes.

Jon
 
M

Martin Horst

Hi,
Jon said:
When you copied the source, did you copy the exact same version of the
source that created the DLL? I believe the PDB contains hashes of the
source so it can detect changes.

Jon

BINGO. You are absolutly right. I tried to use another class and now I
can debug into the code. The class I tested with was newer on my machine
(nightly builds). So I now the problem, is time to fix it.

Thanks to all for your help
Best regards
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top