Why isn't argument passed in?

I have a winform app and set a conditional compilation symbol for the project.  In the Program.cs file, I do this:

[STAThread]
static void Main(string[] args )
{...}

but there is never anything in the args variable.  Do I need to do something else?
brettrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
the args is what you pass from the command line to the program.
do you pass anything to the program?
0
brettrAuthor Commented:
In the project properties for conditional compilation symbols, I specify a string.
0
dstanley9Commented:
Those don't go to the args.  If you want to pass in arguments from studio, add them to the "Command Line Arguments" under the Debug tab
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

brettrAuthor Commented:
Arg!  You're absolutely right.  These are only available when compiling in debug right?
0
dstanley9Commented:
No.  you can use different settings when building debug vs release modes, though.  They are used whenever you start the app from within studio (with or without debugging)
0
brettrAuthor Commented:
If I compile in release, it doesn't capture the argument.  Only when compiled in debug.
0
dstanley9Commented:
Whan looking at the project properties, change the "Configuration" drop-down to Release and set the arguments there.  If you added the args in the Debug configuration, it doesn't automatically copy to other configurations. You can change the drop-down to "All" to set the same value in all configurations.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brettrAuthor Commented:
I see.  Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.