none
Debugging DLL - how does .NET find source?

    Question

  • Hi,

     

    I have created a Class Library project called "Logging". I compile this into one DLL called "logging.dll". Then I create a new project called "Consumer". I copy the "logging.dll" to the Consumers "bin" folder and references this DLL.

     

    If I debug the "Consumer" project I am able to step into the source code of the "Logging" project. How? How does the debugger know where to find this specific DLL source code?

     

    --

    Werner

     

    Thursday, November 22, 2007 2:41 PM

Answers

  • Ok I found something. If I compile the class library with "Properties/build/Advanced Build Settings/Debug Info" set to "none" I cannot step into that particular DLL. So apparantly even in release there are still debug information at hand by default. And this information must be in the DLL because I havent copied the PDB file - I even tried to delete the PDB file just to be sure. That was new to me.

     

    Thanks for your input Kent Smile

     

    --

    Werner

    Friday, November 23, 2007 10:55 AM

All replies

  • Did you also copy the Logging.pdb file to the bin folder of the consumer? Among other things, the PDB file contains source location information.

    HTH,
    Kent
    Thursday, November 22, 2007 4:28 PM
  •  Kent Boogaart wrote:
    Did you also copy the Logging.pdb file to the bin folder of the consumer? Among other things, the PDB file contains source location information.

     

    No Smile

    Same project copied to another PC where it just steps over the method call into "logging.dll". Btw the logging.dll is release version. All in all the debug info is comming from the project not the dll. Come to think of it - the logging.dll has a strong name - perhaps its Visual Studio that from that fingerprint identifies the assemblys project??? hm...

     

    --

    Werner

    Thursday, November 22, 2007 7:47 PM
  • Have you checked your options in VS to see whether you have symbol paths added? Go to Tools/Options/Debugging/Symbols and see what's there.

    HTH,
    Kent
    Friday, November 23, 2007 10:21 AM
  •  Kent Boogaart wrote:
    Have you checked your options in VS to see whether you have symbol paths added? Go to Tools/Options/Debugging/Symbols and see what's there.

     

    Nothing there...And the idea with the strong name was nothing. I just:

    1. Created new (no strong name) test.dll with method "Hello".
    2. Compiled it with release
    3. Created new WindowsApplication App.exe
    4. Copy test.dll to debug/bin folder of the Windows apllication
    5. Reference the test.dll and call "Hello" method.

    And when debugging App.exe I am able to step into the source code of method "Hello". Smile

     

    --

    Werner

    Friday, November 23, 2007 10:44 AM
  • Ok I found something. If I compile the class library with "Properties/build/Advanced Build Settings/Debug Info" set to "none" I cannot step into that particular DLL. So apparantly even in release there are still debug information at hand by default. And this information must be in the DLL because I havent copied the PDB file - I even tried to delete the PDB file just to be sure. That was new to me.

     

    Thanks for your input Kent Smile

     

    --

    Werner

    Friday, November 23, 2007 10:55 AM