How do I run a dll in break mode

Posted on 2007-10-08
Last Modified: 2013-11-26
I have written a dll that launches from another application that I have written. I want to run the dll in debug mode with break points but when it is launched from the application it always runs the compiled dll and not the source code. I have set the dll to launch the desired application when started which it is doing. If I delete the compiled dll to try force it to use the source code in debug mode then it gives me "an unhandled exception of type '' occured in mscorlib.dll".
Question by:PantoffelSlippers
    LVL 53

    Assisted Solution

    The easiest solution:
    1. Open your project where you have a reference to the dll.
    2. Add the dll project to your solution.
    3. Remove the reference to the dll (in your calling project)
    4. Add a reference to the dll-project (in your calling project)

    Now set your breakpoints and run the program. Now it will go into the dll...
    LVL 16

    Expert Comment

    The key to making this work is opeing a copy of the Source File you want to debug in the current solution. you need to make sure the breakpoints are set on the file in the current solution.

    You should then see the code breaks.
    LVL 62

    Accepted Solution

    Hi PantoffelSlippers;

    This is how I do it.

    1. Open the DLL project in Visual Studio.
    2. Set the breakpoints that you want.
    3. Open the projects property page.
    4. Select the Debug tab on the left side of the window
    5. Select the radio button near the top that states, "Start external program", then click on the button at the right of the text box and browse to the program that uses the DLL and select it.
    6. If the program needs any command line arguments place them in the, "Command Line Arguments text box a little bit down the page.
    7. The go to the main menu Debug -> Start Debugging
    8. Your application will start and when you hit the breakpoint in your code in the dll it will stop.

    LVL 16

    Expert Comment

    Have you recieved a satisfactory solution?

    Author Comment


    Solution provided by FernandoSoto works for me.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    758 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

    9 Experts available now in Live!

    Get 1:1 Help Now