How do I start a program with arguments when debugging?

前端 未结 6 1950
南笙
南笙 2020-12-04 13:50

I want to debug a program in Visual Studio 2008. The problem is that it exits if it doesn\'t get arguments. This is from the main method:

if (args == null ||         


        
6条回答
  •  悲哀的现实
    2020-12-04 14:32

    for .NET Core console apps you can do this 2 ways - from the launchsettings.json or the properties menu.

    Launchsettings.json

    or right click the project > properties > debug tab on left

    see "Application Arguments:"

    • this is " " (space) delimited, no need for any commas. just start typing. each space " " will represent a new input parameter.
    • (whatever changes you make here will be reflected in the launchsettings.json file...)

提交回复
热议问题