Visual Studio中:自动附加到一个进程,当该过程产生了

编程入门 行业动态 更新时间:2024-10-08 04:31:23
本文介绍了Visual Studio中:自动附加到一个进程,当该过程产生了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要附加到一个进程(a.exe的),只要它是催生,它是可行的与VS?我只知道进程的名称。其实我想要的东西来完成设置在C#代码中设置断点,但代码是属于将由当前运行的应用程序(c.exe)推出另一个可执行文件。该代码是初始化时期内,因此是不可能的,我做手动附加。

I want to attach to a process(a.exe) as soon as it is spawned, is it doable with VS? I only know the name of the process. Actually what I want to accomplish is set a breakpoint in c# code, but the code is belonging to another executable which will be launched by current running application(c.exe). The code is inside the initialize period so it is impossible for me to do the attach manually.

推荐答案

在我所面临这个情况之前(我控制这两个进程),我找到了一个体面的解决方法是将调用的 Debugger.Launch()。那么VS会弹出一个对话框,让你附加到该进程。

When I've faced this situation before (and I controlled both processes), I found a decent workaround is to put a call to Debugger.Launch() in the spawning process' entry point. VS will then pop up a dialog box and let you attach to the process.

更多推荐

Visual Studio中:自动附加到一个进程,当该过程产生了

本文发布于:2023-06-02 00:51:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/431001.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:进程   产生了   过程   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!