I have a very basic Visual Studio console app:
using System;
namespace BasicApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(args.Length);
}
}
}
I can run it just fine from inside Visual Studio by clicking the green triangle "Run" button, but I also want to be able to run it from the command line and pass it some arguments. I'm a little confused by the file structure of Visual Studio projects and I don't know too much about how compiling works. What do I need to type into the command line in order to make it run?
If you want to run the program with command line parameters in Visual Studio, you can go to the main menu and follow below order:
After inputting your command line arguments there, the arguments will be passed to Visual Studio debugger.
Please see the attached screenshot.

MyProject\MyProject\bin\Debug\netcoreapp3.0\.netcoreapp3.0 directory, simply execute MyProject.exe from the command line.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With