Passing command line parameters with Visual Studio C#

前端 未结 2 1971
情书的邮戳
情书的邮戳 2020-11-29 09:02

How do I set the command line arguments for a console application I am debugging in Visual Studio? I\'ve done this in Eclipse, is there a similar option in Visual Studio?

2条回答
  •  悲哀的现实
    2020-11-29 09:43

    In 2020, if you are now using VSCode, you can set the arguments in the lauch.json file.

     "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/CreatePRUDFileClient.dll",
            "args": [argument1, argument2, argument3],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
    

提交回复
热议问题