但是不是这样,因为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 Optionsas 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调试子进程启动时
发布评论