문제

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