How to run a .NET Core application with arguments (Windows)

It was not obvious. I assumed, like the newbie I was, that I would do it the same way I would have with a .exe-based console application in the .NET Framework. I was mistaken. Running a .NET Core application from the terminal was not obvious.

Enter the solution: dotnet run — <args>

example usage

The two hyphens apparently indicate that the subsequent arguments are for the program being run. “uganda” is the argument being sent to the application being run with the dotnet runtime environment.

Leave a comment