How to: Switch to Another Thread While Debugging

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic applies Topic does not apply

Standard

Topic applies Topic applies Topic applies

Topic applies

Pro and Team

Topic applies

Topic applies

Topic applies

Topic applies

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

When you debug a multithreaded application, you will often want to switch context from the thread you have been working with to another thread. Visual Studio provides several ways for you to do this.

To switch to a thread in a source window

  1. In the left gutter of the source window, right-click a thread indicator.

  2. On the shortcut menu, point to Switch to, then click the name of a thread you want to activate.

    Only the threads at that specific location appear on the shortcut menu.

To switch to a thread in the Threads window

  1. Right-click any thread that appears in the Threads window.

  2. In the shortcut menu, click Switch to Thread.

To switch to a thread in the Debug Location toolbar

  1. In the Debug Location toolbar, click the Thread box.

    A drop-down list appears that displays all threads or all flagged threads, depending on the current setting for the Thread list.

  2. In the drop-down list, click the thread you want to switch to.

  3. If you do not see the thread you want in the drop-down list, check the flag indicator next to the drop-down box. If the flag indicator is highlighted, the Thread list is set to show only flagged threads. Click on the flag indicator to toggle the display to show all threads. Then repeat steps 1 and 2.

See Also

Other Resources

Debugging Multithreaded Applications