Debugging a command line c# windows Application

  • Thread starter Thread starter lavu
  • Start date Start date
L

lavu

How can I debug a C# GUI app which is invoked from the command line ?


Thanks in advance.
 
lavu,

You can have the debugger attach to the process. Run your app, then
look under the debug menu for "attach to process". Then, you attach to the
process and viola, you are debugging.

Also, if you want to have command line parameters passed to your app
during debugging, you can set the startup properties of the project so that
you can feed command line parameters to it (instead of having to do it from
the command line).

Hope this helps.
 
| How can I debug a C# GUI app which is invoked from the command line ?
|
|
| Thanks in advance.
|

VsJITDebugger.exe -p <pid>
where pid is the process id of the running app. you want to debug.

Willy.
 
My problem is that I need the debugger to debug right from the
beginning of the application , not after a process/or pid is
available for that app.
I used Nicholas' second suggestion and passed command line params
through my startup properties. That worked like a
charm. Thank you.
 
Look in the Project Properties under Configuration Properties ->
Debugging. You'll see a property called "Command Line Arguments". Put
your command line arguments in there and then just use the Debugger as
you would for any Windows application.
 
| My problem is that I need the debugger to debug right from the
| beginning of the application , not after a process/or pid is
| available for that app.
| I used Nicholas' second suggestion and passed command line params
| through my startup properties. That worked like a
| charm. Thank you.
|

For this you can run devenv.exe /debugexe "execname" args.


Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top