|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Debug DLLs
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.
When you debug a DLL, you can start debugging from:
The project used to create the executable that calls the DLL.
- or -
The project used to create the DLL itself.
If you have the project used to create the executable, start debugging from that project. You can then open a source file for the DLL and set breakpoints in that file, even though it is not a part of the project used to create the executable. For more information, see Breakpoints.
If you start debugging from the project that creates the DLL, you must specify the executable you want to use in debugging the DLL.
To specify an executable for the debug session
In Solution Explorer, select the project that creates the DLL.
From the View menu, chooseProperty Pages.
In the Property Pages dialog box, open the Configuration Properties folder and select the Debugging category.
In the Command box, specify the path name for the container. For example, C:\Program Files\MyApplication\MYAPP.EXE.
In the Command Arguments box, specify any necessary arguments for the executable.
If you do not specify the executable in the Project Property Pages dialog box, the Executable for Debugging Session Dialog Box appears when you start debugging.