Running a C # program with command line prompts in Visual Studio Code
I am running a legacy project written in C # inside Visual Studio Code. To run this application, you need to do command line input (-t, -h, etc.). How can I check this from within Visual Studio?
Currently (I am learning dotnet, C #, VS, etc. as I leave) I have a global hello program that I can run from the vsc terminal. For some reason I was not able to determine exactly, perhaps how I installed it is dotnet run
not recognized - I have to pass it the explicit path to dotnet.exe:C:\Program Files\dotnet\dotnet.exe run
How do I do this when a program requires command line input? My shot in the dark C:\Program Files\dotnet\dotnet.exe run -t
supposedly didn't work, but I'm not sure what else to try.
Thank!
source to share
If you are using dotnet.exe run
to run your application, you need to add a switch statement --
to instruct you dotnet.exe
to pass arguments to your application. for example
dotnet.exe run -- -arg1 -arg2 (etc)
pay attention to --
after the arguments dotnet
and before your specific program arguments.
source to share