Friday, February 08, 2008

Passing Command Line Arguments in Visual Studio

Recently, my friend Kishore asked me how to pass command line arguments to applications through Visual Studio. It has been long time since I ever passed any command line args to apps while debugging. For convenience sake, I usually hard code and later change it once I think my app does not break(which is not good ofcourse). Anyway, here is how you do ...

1. Go to Solution Explorer. Right click on the project and click Properties
2. Now in the Properties page that you see, go to Debug tab.
3. In debug tab, go to Start Options Section in which you see a textarea with title "Command Line Arguments"

Simple enough but not as easy as it should be. There should have been a menu item within build which you can use to directly pass arguments to your application. May be, a Visual Studio Add-in could do that, but the add-in development is very painful and the documentation does not match with what Visual Studio 2008 actually gives.

4 comments:

Anonymous said...

Thanks, really appreciated.

Anonymous said...

Helped :) thanks!!

Anonymous said...

Спасибо! Помогло!
From Russia with love!

Anonymous said...

Thanks a lot...