VS2010 debugging multi-process--the use of medical his debugging

Source: Internet
Author: User

Sometimes it comes to your own development program embedded in someone else's frame, and there is a problem in the interface, but it is not convenient to add their own mold quickly to other people's projects this time vs attached to the process of debugging become indispensable, straight to the topic

Http://msdn.microsoft.com/zh-cn/library/ms123401.aspx

Select Startup Project
    1. In Solution Explorer, right-click the project name, and then on the shortcut menu, select Set as Startup Project.

    2. If you want to debug more than one project, you can select multiple startup projects.

Select multiple Startup Projects
    1. In Solution Explorer, right-click the solution name and on the shortcut menu, select Properties.

      The Solution Property Pages dialog box appears.

    2. In the Solution Property Pages dialog box, select the Multiple Startup Projects option.

    3. Under multiple startup projects, there is a grid with two columns, and the two columns are project and action. In the Action column:

      1. For each project you want to debug, click the Action column and select Start.

      2. For projects that you want to run without debugging, click the Action column and select Start (Do not debug).

      3. For projects that you do not want to run, click the Action column and select None.

    4. Click OK.

Debugging multiple processes

With the Visual Studio debugger, you can debug programs that run in multiple processes. A process is a program instance that runs in its own memory space and has its own target code, data, and resources. For example, when you pass the start. EXE file when you start a program, the system scheduler creates a new process for the program. If you start multiple instances of a program, multiple processes are created. For its own purposes, the operating system automatically creates additional processes (that is, system processes).

Some programs, such as script applications, do not have their own processes. These programs reside in other applications, such as Internet Explorer or Internet Information Services, and run in the host process. To debug such a program, you must debug the host process. Typically, you attach to the host process first.

Using the Visual Studio debugger, you can debug multiple processes in one Visual Studio solution. At this point, each process is created by a separate project in the solution, so it can be thought of as debugging multiple projects. You can debug multiple processes by setting up multiple startup projects, or you can start debugging a project and start other projects from Solution Explorer. See Choosing a Startup Item.

To switch from debugging one process to debugging another process, use the Debug Location toolbar.

How to: Debug multiple processes to start other projects

Starting another when a project is running requires that the two projects must be in the same solution. You can start one or more other projects by using Solution Explorer:

To start a project in Solution Explorer
    1. In Solution Explorer, select the project you want to start debugging.

    2. Right-click the project name or icon.

    3. Choose Debug from the shortcut menu, and then click Start a new instance or enter and step into a new instance.

Switch between running projects

When you debug more than two items in a solution, you can switch between them in one of the following two ways:

To switch between projects during the debugging process
    1. If the Debug Location toolbar is not visible:

      1. From the Tools menu, choose Custom.

      2. In the custom property sheet, select the Toolbars tab, and then select Debug Location.

      3. Click OK.

    2. On the Debug Location toolbar, use the Programs list box to select the program you want to switch to.

Switching to a project makes it the current process for debugging purposes. Any debugger windows that you view will display the status of the current process.

By default, interrupting the current process interrupts all processes being debugged. You can change this default behavior so that only the current process is interrupted, and other processes continue to run.

Changing the process interrupt behavior stops only the current process
    1. From the Tools menu, choose Options.

    2. In the Options dialog box, open the Debugging folder, and then select the general category.

    3. Toggle the "Break all processes when one process is interrupted" option.

    4. Click OK.

======================================================

Set a breakpoint on the page you want to test and choose Debug, attach to process, select the W3wp.exe process in the process (you need to open the page you want to test first)

5. The configuration is complete, when you open the page you need to test, the breakpoint will jump to vs!

============================================================================

From the Debug menu, choose Attach to process.

(If no items are open, from the Tools menu, choose Attach to process.) )

(Related instructions)
In the Attach to Process dialog box, in the Available Processes list, locate the program that you want to attach to.
If the program you are debugging is running on a different calculator, you must first select the remote computer.

If the process is running under a different user account, check the show processes from all users box.
If you are connected through a Remote Desktop connection, select the show processes in all sessions box.
In the Attach to box, make sure that the type of code you want to debug is listed, or that automatic: managed code is displayed. Otherwise: click "Select".
In the Select Code Type dialog box, click Debug the following code types, and then select the type that you want to debug.
Click OK.
Click the Attach button.
When you open the Processes dialog box, the Available Processes list is automatically displayed. When the dialog box is open, the process can still start and stop in the background, so the content may not always be up to date. By pressing refresh, you can refresh the list at any time to see a list of current processes.
You can attach to multiple programs while debugging, but only one program in the debugger is active at any given time. You can set the active program in the Debug Location toolbar.

All of the Debug menu execution commands will affect the active program. You can break any debugged program from the Processes dialog box

VS2010 debugging multi-process--the use of medical his debugging

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.