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?
Press F5 to run the program in Debug mode. Another way to start debugging is by choosing Debug > Start Debugging from the menu. Enter a string in the console window when the program prompts for a name, and then press Enter . Program execution stops when it reaches the breakpoint and before the Console.
In Visual Studio 2010, right click the project, choose Properties, click the configuring properties section on the left pane, then click Debugging, then on the right pane there is a box for command arguments. In that enter the command line arguments. You are good to go. Now debug and see the result.
You have some options:
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
c:> tasklist | find /i "web"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With