How to: Debug from a DLL Project
This topic applies to:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
||||
Standard |
||||
Pro and Team |
Table legend:
Applies |
|
Does not apply |
|
Command or commands hidden by default. |
To start debugging from the DLL project instead of 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 C++ Property Pages differ in layout and content from the C# and Visual Basic Property Pages. Refer to the procedure 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.
Note
You cannot specify an external calling application in Express versions. To debug a DLL in an Express version, add an executable project to the solution, set it as the start point for the solution, and call methods in your DLL from the executable project.
To specify the calling application in a C++ project
In Solution Explorer, select the DLL project.
On the View menu, choose Property Pages.
In the Project Property Pages window, in the Configuration drop-down list, choose Debug.
Open the Configuration Properties folder, and select the Debugging category.
In the Debugger to launch list, choose Local Windows Debugger or Remote Windows Debugger.
In the Command or Remote Command box, click the drop-down arrow, and select Browse from the list to locate the application. Alternatively, type the path and name of the application.
Type any necessary program arguments in the Command Arguments box.
To specify the calling application in a C# or Visual Basic project
In Solution Explorer, select the DLL project.
On the View menu, choose Property Pages.
In the Project Property Pages window, in the Configuration drop-down list, choose Debug.
Click the Debug tab.
You can start the application by either doing the following:
Set the Start Action to Start external program.
In the Start external program box, click the ellipsis button to browse for the application.
Enter any necessary program arguments in the Command Line Arguments box.
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.)
Under Start Action, select the Start browser in URL: radio button.
In the adjoining text box, type the URL.
To start debugging from the DLL project
In Solution Explorer, select the DLL project.
Set breakpoints as needed.
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 it is necessary.
See Also
Tasks
Concepts
Project Settings for C# Debug Configurations
Project Settings for a Visual Basic Debug Configuration