سؤال

I'm working on a console application with a lot of command line argument. I can set them for debug in project properties, but couldn't find the way to do so for case "start without debugging". Is there any solution to this in visual studio 2012?

هل كانت مفيدة؟

المحلول

You can use directives to achieve it, like :

static void Main(string[] args)
        {
#if DEBUG
            args = new[] { "A" };
#endif

            Console.WriteLine(args[0]);
        }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top