Compartilhar via


How to: Debug from a DLL Project 

To start debugging from the DLL project rather than from the calling application, you must enter information in the <Project> Property Pages dialog box or window to indicate where the DLL project can find the calling application. The contents and layout of Property Pages differs between C#, J#, and VB on the one hand, and C++ on the other, so refer to the procedure below that corresponds to your project's language.

If a managed DLL is called by native code and you want to debug both, both managed and native debuggers must be enabled. You can set this in the <Project> Property Pages dialog box or window. For more information, see How to: Debug in Mixed Mode.

To specify the calling application in a C++ project

  1. In Solution Explorer, select the DLL project.

  2. From the View menu, choose Property Pages.

  3. In the Project Property Pages window, in the Configuration drop-down list, choose Debug.

  4. Open the Configuration Properties folder, and select the Debugging category.

  5. In the Debugger to launch list box, choose Local Windows Debugger or Remote Windows Debugger.

  6. In the Command or Remote Command box, click the drop-down arrow, and select Browse from the list to browse for the application, or type in the path and name of the application.

  7. Type any necessary program arguments in the Command Arguments box.

To specify the calling application in a C#, J#, or VB project

  1. In Solution Explorer, select the DLL project.

  2. From the View menu, choose Property Pages.

  3. In the Project Property Pages window, in the Configuration drop-down list, choose Debug.

  4. Click the Debug tab.

  5. You can start the application by either doing the following:

    1. Set the Start Action to Start external program.

    2. In the Start external program box, click on the ellipsis button to browse for the application.

    3. Enter any necessary program arguments in the Command Line Arguments box.

  6. Or, you can invoke an application at a URL. (You might want to do this if you are debugging a managed DLL used by a local ASP.NET application.)

    1. Under Start Action, select the Start browser in URL: radio button.

    2. In the adjoining textbox, type the URL.

To start debugging from the DLL project

  1. In Solution Explorer, select the DLL project.

  2. Set breakpoints as needed.

  3. Enter the name and location of the calling application in the Project Property Pages dialog box or window. If the application is a console application, fill in the command line arguments, if needed.

See Also

Tasks

How to: Start Execution

Reference

Project Settings for a C++ Debug Configuration

Concepts

Debugging DLL Projects
Project Settings for C# and J# Debug Configurations
Project Settings for a Visual Basic Debug Configuration