Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 - Project Macro Variables in Start Options Command Line Arguments

In a projects settings, on the Debug tab, is there a way to use to use the project macro variables in the command line arguments box?

I know you can't use them directly because they don't get expanded but is there a clever solution to this?

EDIT: I'm using a C# project.

like image 272
Adam Driscoll Avatar asked Oct 28 '10 19:10

Adam Driscoll


People also ask

How do I give command line arguments in Visual Studio?

To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the Properties Pane, go to "Debugging", and in this pane is a line for "Command-line arguments." Add the values you would like to use on this line. They will be passed to the program via the argv array.

What is $( ProjectDir?

$(ProjectDir)The directory of the project (defined as drive + path); includes the trailing backslash '\'.


1 Answers

No, this is supported [but not for C# projects].

Silly example I tried: Command Arguments = $(CharacterSet). Got "Unicode" at runtime for argv[1] inside main().

Select "Command Arguments", click on the dropdown arrow, Edit. Click Macros to see what macros are available.

like image 103
Hans Passant Avatar answered Sep 27 '22 22:09

Hans Passant