Alex Rivera | Logout

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

Asked 2010-05-03T21:09:20.383
34

How do you "Attach to Process..." for a console application thats running from a CMD window and not launched by F5? The reason I ask is because the application takes command line arguments and I want to have a genuine experience.

I've even attaching to CMD.exe, but no luck, or setting a break-point using Console.ReadKey() with also no luck. I'm kind of at a loss here.

Is this possible?

Edit
Report

1 Answer

7

To debug from the command line rather than using the VS GUI maze:

  • Launch the Visual Studio Command Prompt

  • type vsjitdebugger/? which gives you the command example like :

c:> vsjitdebugger [AppName] [Args] : Launch the specified executable and attach to debugger

  • typing tlist or tasklist will give you PIDs for attaching to existing processes. example:

c:> tasklist | find /i "web"

answered 2010-05-18T11:49:57.220

Your Answer