Condividi tramite


How to: Debug Native DLLs

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Note

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 Customizing Development Settings in Visual Studio.

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, chooseProperty Pages.

  3. In the Property Pages dialog box, open the Configuration Properties folder and select the Debugging category.

  4. In the Command box, specify the path name for the container. For example, C:\Program Files\MyApplication\MYAPP.EXE.

  5. In the Command Arguments box, specify any necessary arguments for the executable.

    If you do not specify the executable in the ProjectProperty Pages dialog box, the Executable for Debugging Session Dialog Box appears when you start debugging.

See Also

Debugger Security
Debugging in Visual Studio