Debugging with command-line parameters in Visual Studio

Maciej Gryka picture Maciej Gryka · Nov 18, 2008 · Viewed 406.3k times · Source

I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt) , but this way I can't debug. Is there somewhere I can specify the arguments for debugging?

Answer

Lou Franco picture Lou Franco · Nov 18, 2008

Yes, it's in the Debugging section of the properties page of the project.

In Visual Studio since 2008: right-click the project, choose Properties, go to the Debugging section -- there is a box for "Command Arguments". (Tip: not solution, but project).