Possible Duplicate:
How to get command line from a ClickOnce application?
I was working on a console application and manually added the string[] args
inside of Main() after I had already done a bunch of other work. Is that all I have to do to accept command line arguments? Or do I need to configure something elsewhere also? I keep doing Console.WriteLine("{0}",args.Length)
and get zero no matter what I send after the exe..
class Program
{
static void Main(string[] args)
{
Console.WriteLine("{0}", args.Length);
}
}
then I run ...\setup.exe yes no maybe
and get 0 for length. What more do I need to do?
MORE INFO:
I tried to break after setting command line arguments in the properties page and I get the following error.:
I am thinking that someone's comment about ClickOnce deployment is my problem. How can I deploy in VS2010 to allow this?
MORE INFO:
I disabled "ClickOnce security settings" under Properties -> Security and was able to debug successfully, but when I click on Publish, it automatically turns this setting back on.. How do I prevent that?