Search code examples
debuggingvisual-studio-2010assembliespdb-filesstep-through

Can I use pdb files to step through a 3rd party assembly?


my friend has made a really helpful class library which I use all the time. I usually use Reflector to see what his code does.

What I really wanted to do was to step through his code while I'm debugging. So he gave me his .pdb file.

  • Foo.dll (release configuration, compile)
  • Foo.pdb

Now, I'm not sure how I can get it to auto break into his code when it throws an exception (his code, at various points, thorws exceptions .. like A first chance exception of type 'System.Web.HttpException' occurred in Foo.dll ...

Can I do this? Do i need to setup something with the Symbol Server settings in Visual Studio ? Do i need to get the dll compiled into Debug Configuration and be passed the .dll and .pdb files? Or (and i'm really afraid of this one) .. do i need to have both the .dll, .pdb AND his source code ...

I also had a look at this previous SO question, but it sorta didn't help (but proof I've tried to search before asking a question).

Can someone help me please?


Solution

  • Yes you can, if your friend indexes those PDB's, so that the debugger knows where to find the appropriate source in a source-control system, and if your friend uploads those pdb's to a symbol-server, you can perfectly step through the code while debugging.

    I have done this for some projects at work, and this works like a charm.

    More info about setting up a symbol server:

    Source server helps you kill bugs

    Setting up a symbol server

    Using symstore