据我所了解,使用远程调试器的唯一方法是启动目标应用程序,然后通过Visual Studio将其附加到它。有没有办法从程序的一开始就捕获所有的断点?
As I understand it now, the only way to use the remote debugger is to start the target application, and then attach to it through Visual Studio. Is there a way to capture all of the breakpoints from the very beginning of the program?
程序中有一些代码需要调试,而我永远无法得到
There is code within my program that I need to debug, and I can never get the debugger attached fast enough to capture that executing code.
推荐答案如果可以更改代码,请尝试将以下代码行插入应用程序的起点:
If you can change the code, try injecting this line of code in the starting point of your app:
System.Diagnostics.Debugger.Launch();点击此行会提示您附加调试器,有效地等待您响应。由于您使用的是远程调试器,因此您应该可以在此时进行附加,然后只需取消对话框即可。希望这会有所帮助。
When this line is hit it will prompt you to attach a debugger, effectively waiting for you to respond. Since you are using a remote debugger you should be able to attach at that point and then just cancel the dialog. Hope this helps.
更多推荐
在应用程序启动时进行Visual Studio远程调试
发布评论