How to debug a C# .NET application in Visual Studio 2010 that is started from another process

后端 未结 3 1508
说谎
说谎 2021-01-05 20:08

I have a .NET GUI application written in C# and a PDF printer. The PDF printer has a field where you can set a command to start an external application.

In this case

3条回答
  •  渐次进展
    2021-01-05 21:08

    You can attach to a process when it starts using a small registry tweak.

    Go to

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

    Create a new key with the name of the executable as it will appear in Task Manager, for example, myapp.exe. Under this, create a new string value called debugger and set it to vsjitdebugger.exe.

    Now, when the EXE file is triggered, a window will appear asking which debugger to attach to.

提交回复
热议问题