This documentation is archived and is not being maintained.

Debugging DLLs

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

  1. In Solution Explorer, select the project that creates the DLL.
  2. From the View menu, choose Property Pages.
  3. In the Property Pages dialog box, open the Configuration Properties folder and select the Debugging category. For more information, see <Projectname> Property Pages Dialog Box.
  4. Locate Command (in C/C++), Start Application (C#), or Start External Program (Visual Basic) and specify the path name for the container. For example, C:\Program Files\MyApplication\MYAPP.EXE.
  5. Locate Command Arguments (C/C++), Command Line Arguments (C#), or Command line arguments (Visual Basic) and 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. You must specify the path name of the calling executable in that dialog box. For more information, see Executable for Debugging Session Dialog Box.

See Also

Debugging DLLs FAQ | Debugging

Show: