How to pass parameters to Main() C# in visual studio for mac

Arguments can be supplied to your application within Visual Studio for Mac by right clicking on your console application in the right hand pane then going Options > Run > Configurations > Default where you'll see an Arguments text field.

enter image description here


For some reason, the answer from @JosephWoodward isn't working for me. It looks like a Visual Studio bug, but I do have a workaround; the consequence is that you have to provide the arguments every time you want to start the app.

  1. From the menu, choose Run -> Run With -> Custom Configuration ...

enter image description here

  1. In the dialog, enter the arguments:

enter image description here

  1. If you want to debug instead of run, you need to change the Run Action at the bottom:

enter image description here

Tags:

C#