Sunday, August 12, 2012

Mysterious Command Line Arguments in Visual Studio 2008

I was debugging a VB.NET program and noticed that the program runs with command-line arguments. This wouldn't be strange if not for the fact that when I open the project properties (right click the project and select properties) and check the Debug tab, the Command line arguments section is empty.

Project Properties with advanced build configuration disabled

After monkeying around for a while, I found that Visual Studio lets you simplify the build options, thereby hiding some options in this tab. To show all the available build options, go to Tools -> Options, select General under Projects and Solutions, and check Show advanced build configurations as shown below.

Tools -> Options Dialog


After enabling advanced build configurations, my debug tab now shows the familiar Configuration drop-down, and the corresponding Command line arguments magically appear!

Project Properties dialog with advanced build configuration enabled


Personally, I would have preferred if the Configuration drop-down is always visible. Most developers would probably be confused by this behavior and would not intuitively know to enable advanced build configuration to find the mysterious command line arguments in this program.

No comments:

Post a Comment