Skip to content

Commit a0ff3c8

Browse files
Merge pull request #10716 from MicrosoftDocs/main638803622779820535sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents a605d5a + 37292a2 commit a0ff3c8

34 files changed

+678
-356
lines changed

docs/debugger/debugging-dll-projects.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debug dynamic-link library (DLL) files and projects
33
description: Debug dynamic-link library (DLL) files in Visual Studio, and use Visual Studio to create, build, configure, and debug DLLs.
4-
ms.date: "04/18/2022"
4+
ms.date: "04/15/2025"
55
ms.topic: "conceptual"
66
dev_langs:
77
- "CSharp"
@@ -26,25 +26,23 @@ A DLL (dynamic-link library) is a library that contains code and data that can b
2626

2727
The following Visual Studio project templates can create DLLs:
2828

29-
- C#, Visual Basic, or F# Class Library
30-
- C# or Visual Basic Windows Forms Control (WCF) Library
31-
- C++ Dynamic-Link Library (DLL)
29+
- Class Library (.NET, .NET Framework, and other app platforms)
30+
- Windows Forms Control Library (.NET and .NET Framework)
31+
- Dynamic-Link Library (DLL) (C++)
3232

33-
For more information, see [MFC debugging techniques](../debugger/mfc-debugging-techniques.md).
34-
35-
Debugging a WCF Library is similar to debugging a Class Library. For details, see [Windows Forms Controls](/dotnet/framework/winforms/controls/index).
33+
Debugging a Windows Forms Control Library is similar to debugging a Class Library. For more information, see [Windows Forms Controls](/dotnet/framework/winforms/controls/index).
3634

3735
You usually call a DLL from another project. When you debug the calling project, depending on the DLL configuration, you can step into and debug the DLL code.
3836

3937
## <a name="vxtskdebuggingdllprojectschangingdefaultconfigurations"></a> DLL debug configuration
4038

4139
When you use a Visual Studio project template to create an app, Visual Studio automatically creates required settings for Debug and Release build configurations. You can change these settings if necessary. For more information, see the following articles:
4240

41+
- [How to: Set Debug and Release configurations](../debugger/how-to-set-debug-and-release-configurations.md)
4342
- [Project settings for a C++ debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md)
4443
- [Project settings for .NET C# debug configurations](../debugger/project-settings-for-csharp-debug-configurations-dotnetcore.md)
4544
- [Project settings for C# debug configurations](../debugger/project-settings-for-csharp-debug-configurations.md)
4645
- [Project settings for a Visual Basic debug configuration](../debugger/project-settings-for-a-visual-basic-debug-configuration.md)
47-
- [How to: Set Debug and Release configurations](../debugger/how-to-set-debug-and-release-configurations.md)
4846

4947
### Set C++ DebuggableAttribute
5048

@@ -82,20 +80,18 @@ For more information on C++ project settings, see [Windows C++ property page ref
8280

8381
## <a name="vxtskdebuggingdllprojectsbuildingadebugversion"></a> Build a Debug version
8482

85-
Make sure to build a Debug version of the DLL before you start debugging. To debug a DLL, a calling app must be able to find its [.pdb file](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md) and any other files the DLL requires.
83+
Make sure to build a Debug version of the DLL before you start debugging. To debug a DLL, a calling app must be able to find its [.pdb file](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md) and any other files the DLL requires. For more information, see [How to: Set Debug and Release configurations](../debugger/how-to-set-debug-and-release-configurations.md).
8684

8785
You can create a custom build task to copy the DLL files to your *\<calling project folder>\Debug* output folder, or you can copy the files there manually.
8886

8987
Make sure to call the DLL in its correct location. This may seem obvious, but if a calling app finds and loads a different copy of the DLL, the debugger will never hit the breakpoints you set.
9088

9189
## <a name="vxtskdebuggingdllprojectswaystodebugthedll"></a> Debug a DLL
9290

93-
You can't run a DLL directly. It must be called by an app, usually an *.exe* file. For more information, see [Visual Studio projects - C++](/cpp/ide/creating-and-managing-visual-cpp-projects).
91+
You can't run a DLL directly. It must be called by an app, usually an *.exe* file.
9492

9593
To debug a DLL, you can [start debugging from the calling app](#vxtskdebuggingdllprojectsthecallingapplication), or [debug from the DLL project](how-to-debug-from-a-dll-project.md) by specifying its calling app. You can also use the debugger [Immediate window](#vxtskdebuggingdllprojectstheimmediatewindow) to evaluate DLL functions or methods at design time, without using a calling app.
9694

97-
For more information, see [First look at the debugger](../debugger/debugger-feature-tour.md).
98-
9995
### <a name="vxtskdebuggingdllprojectsthecallingapplication"></a> Start debugging from the calling app
10096

10197
The app that calls a DLL can be:
@@ -105,6 +101,8 @@ The app that calls a DLL can be:
105101
- Located on the web and accessed through a URL.
106102
- A web app with a web page that embeds the DLL.
107103

104+
Before you start debugging the calling app, set a breakpoint in the DLL. See [Get started with breakpoints](../debugger/get-started-with-breakpoints.md). When the DLL breakpoint is hit, you can step through the code, observing the action at each line. For more information, see [Navigate code in the debugger](../debugger/navigating-through-code-with-the-debugger.md).
105+
108106
To debug a DLL from a calling app, you can:
109107

110108
- Open the project for the calling app, and start debugging by selecting **Debug** > **Start Debugging** or pressing **F5**.
@@ -113,8 +111,6 @@ To debug a DLL from a calling app, you can:
113111

114112
- Attach to an app that is already deployed and running on a test or production computer. Use this method for DLLs on websites or in web apps. For more information, see [How to: Attach to a running process](../debugger/attach-to-running-processes-with-the-visual-studio-debugger.md).
115113

116-
Before you start debugging the calling app, set a breakpoint in the DLL. See [Using breakpoints](../debugger/using-breakpoints.md). When the DLL breakpoint is hit, you can step through the code, observing the action at each line. For more information, see [Navigate code in the debugger](../debugger/navigating-through-code-with-the-debugger.md).
117-
118114
During debugging, you can use the **Modules** window to verify the DLLs and *.exe* files the app loads. To open the **Modules** window, while debugging, select **Debug** > **Windows** > **Modules**. For more information, see [How to: Use the Modules window](../debugger/how-to-use-the-modules-window.md).
119115

120116
### <a name="vxtskdebuggingdllprojectstheimmediatewindow"></a> Use the Immediate window

0 commit comments

Comments
 (0)