How do I debug a referenced DLL in Visual Studio?

Posted on 2014-08-17
Last Modified: 2014-08-25
My team has built an assembly and there seems to be a problem in it.  The assembly is just referenced in my main project.  What are the steps, if any, to debug this from my main project?
Question by:Bruce
    LVL 40

    Assisted Solution

    by:Jacques Bourgeois (James Burger)
    First of all, add the dll project to your testing project through File...Add...Existing Project.

    In the References window, instead of referencing the dll as you do with most dlls, go into the Solution or Projects tab (depending on your version of Visual Studio) and select your dll project instead of the dll itself. This is akind to referencing the source code.

    The debugger will then be active in both the testing application and the dll, switching from one project to  another as necessary, even if you debug step by step.
    LVL 27

    Accepted Solution

    Rebuild the problematic project in Debug mode on your own machine (so that file paths in that PDB are specific to your machine).

    Copy both .DLL and .PDB files to your references folder. Visual Studio will pick up the .PDB file automatically and use the file paths to show source.

    If you don't have the code, you can use .Net Reflector (It's commerical now)
    LVL 74

    Assisted Solution

    by:käµfm³d 👽
    Rebuild the problematic project in Debug mode on your own machine (so that file paths in that PDB are specific to your machine).
    This is very important. The .pdb files have to be the ones generated at the time of the build. Even if you have a set of .pdb files that exactly match in source code, if they were not from the same exact build, then you won't be able to use them.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    How do I fix a datagridview scramble in a Windows Form? 9 38
    Handling arrays 14 28
    Xamarin 10 18
    DataGridView 2 13
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now