Visual Studio调试子进程启动时 [英] Visual studio debug child process on its startup

查看:322
本文介绍了Visual Studio调试子进程启动时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序,加载后(一些wcf服务)我正在运行一个子进程(更少的Windows应用程序)。

这两个项目都在我的解决方案。

我希望调试这两个,我知道如果我在多个启动项目下的解决方案属性中设置了动作=启动,我可以调试2个项目。



但是不是这样,因为WPF应用程序在X时间后启动子进程。我不能附加到进程,因为我想抓住子进程的主要方法。



是否有解决方案?

目前为止,我所做的是禁用CreateNewProcess()方法,放置应该发生的断点,并手动调试项目,然后从该断点继续使用WPF应用程序,使用2个视觉工作室。

解决方案

使用调试器设置

  HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image文件执行选项

as 在本博客文章中描述,使子进程在启动时自动中断。然后,出现提示时,选择您正在使用的Visual Studio实例来调试父进程。


I have a WPF Application, after it is loading (some wcf services) i am running a child process (Gui less Windows Application).
Both projects are in my solution.
I Wish to debug both of them, I know i can debug 2 projects if i set both of with action = start in the Solution properties under "Multiple startup projects".

But this is not the case, since the WPF app is starting the child process after X time. And i cannot "Attach to process" since i want to catch the main method of the child process.

Is there a solution ?
What i did so far was to disable the CreateNewProcess() method, place a break point where it should occur, and manually debug the project, and then continue the WPF app from that break point, using 2 visual studios..

解决方案

Use the debugger settings Registry key under

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options

as described in this blog post to make the child process automatically break on startup. Then, when prompted, choose the Visual Studio instance you're using to debug the parent process.

这篇关于Visual Studio调试子进程启动时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆