Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why isn't argument passed in?

Posted on 2007-03-30
8
Medium Priority
?
209 Views
Last Modified: 2010-04-16
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?
0
Comment
Question by:brettr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18823761
the args is what you pass from the command line to the program.
do you pass anything to the program?
0
 

Author Comment

by:brettr
ID: 18823797
In the project properties for conditional compilation symbols, I specify a string.
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 18823935
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:brettr
ID: 18824078
Arg!  You're absolutely right.  These are only available when compiling in debug right?
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 18824098
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
 

Author Comment

by:brettr
ID: 18824351
If I compile in release, it doesn't capture the argument.  Only when compiled in debug.
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 2000 total points
ID: 18824378
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
 

Author Comment

by:brettr
ID: 18824460
I see.  Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question