Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run dotnet core app from command line? [duplicate]

I created a CLI tool using dotnet core framwork and I want to run it form the console as:

$ candyapp --arg1 some-value

I run it now by going to the location where the dll file is by uing:

$ dotnet candyapp.dll candyapp --arg1

Can anyone help me install my application and use it on my mac?

like image 602
Mustafa Dwekat Avatar asked May 27 '18 20:05

Mustafa Dwekat


People also ask

How do I run a .NET core console app from the command line?

Right click the Console App Project and select Publish. Then change Deployment Mode to Self-contained or Framework dependent. . NET Core 3.0 introduces a Single file deployment which is a single executable. Use "framework dependent" if you know the target machine has a .


1 Answers

Use the run command line args of the dotnet app.

dotnet run [-c|--configuration] [-f|--framework] [--force] [--launch-profile] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] [--runtime] [[--] [application arguments]]

For more info, please see dotnet cli

like image 84
Ess Avatar answered Oct 05 '22 09:10

Ess