

Choose whether to display only flagged threads, or all threads, from the Debug Location or Threads window toolbars. You can flag threads to keep track of threads you want to pay special attention to.įlag and unflag threads from the source code editor or from the Threads window. Right-click the thread marker in the source code to see the available options on the shortcut menu. Right-click the thread and select Rename. To help identify nameless threads, you can rename them in the Threads window. A DataTip appears, showing the name and thread ID number for the stopped thread or threads. Hover the pointer over the thread marker. If there is more than one stopped thread at the location, the icon appears. The thread marker indicates that a thread is stopped at this location. The gutter next to the source code line now displays a thread marker icon. Right-click in the Threads window, and select Show Threads in Source from the menu.In the source code, locate the Console.WriteLine() line. You must be in a debugging session to open or see the Threads and other debugging windows. While in break mode, open the Threads window by selecting Debug > Windows > Threads. The app starts in debug mode, and pauses at the breakpoint. Select Debug > Start Debugging, or press F5. The breakpoint appears as a red circle in the left gutter next to the code line. Set a breakpoint on the Console.WriteLine() line by clicking in the left gutter, or selecting the line and pressing F9. NET Core or for C++, and then choose Next. Next, choose C# or C++ from the Language list, and then choose Windows from the Platform list.Īfter you apply the language and platform filters, choose the Console App for. On the Create a new project window, enter or type console in the search box. On the start window, choose Create a new project. If the start window is not open, choose File > Start Window. Open Visual Studio and create a new project. Create a multithreaded app projectĬreate the following multithreaded app project to use in this tutorial: For information about other tools for debugging multithreaded apps, see Get started debugging multithreaded apps.Ĭompleting this tutorial takes only a few minutes, and familiarizes you with the basics of debugging multithreaded apps. This article introduces multithreaded debugging features in the code editor window, Debug Location toolbar, and Threads window. Several Visual Studio user interface elements help you debug multithreaded apps. Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
