How do I attach Visual Studio to a process that is not started yet?

前端 未结 8 1180
不思量自难忘°
不思量自难忘° 2020-12-02 07:41

I have .NET program that can\'t be run from Visual Studio for some reasons (Excel file created from an Excel 2010 template project) for which I need to debug startup events.

8条回答
  •  不思量自难忘°
    2020-12-02 08:03

    I was debugging a C++ plugin in an externally spawned process that crashed by throwing an exception at startup and this worked perfectly for me:

    Add the free Reattach Extension for Visual Studio. Ask it to reattach to the process name before it is launched. It will pop a modal dialog saying it is waiting for the process name to launch.

    Now launch the process and the Visual Studio debugger will attach immediately, catching exceptions and hitting breakpoints.

提交回复
热议问题