Tuesday, March 10, 2009

Command Line arguments in Visual Studio

In Visual studio, there is a bug that prevents command line arguments to passing to a debugged application if the project is NOT the "Startup Project".

) Select the project that has your main(argc, argv),
) Edit the "Command Arguments" property on the Debugging property page.
) Right click on the project and select "Set as Startup Project" from the menu.

Now when debugging, the arguments should be correctly passed to the application.

Many posters on MSDN ask about this bug, my post of this workaround was the first appearance of a functional work-around.

No comments:

Post a Comment