Debugging: Attach to Process for Console App running inside cmd.exe

You have some options:

  • Use “Debug -> Command line arguments” option in Visual Studio;
  • Use “Debug -> Attach to process” and find your process; it is not cmd.exe, but a process with executable name like “MyProject.exe”. You can use Process Explorer or another task manager with “tree view” support to easily find the Process ID – just look for the processes started by your cmd.exe.
  • On Windows (as of 2022), put Debugger.Launch() or Debugger.Break() into your code – with this executed, the system will launch a dialog asking you to choose what instance of Visual Studio to use for debugging (you can choose the one with your project already open).

Leave a Comment

techhipbettruvabetnorabahisbahis forumueduseduedusedusedusedusedueduseduedus