如何从命令行运行dotnet核心应用程序?

Mus*_*kat 6 c# command-line-interface .net-core

我使用dotnet核心框架创建了一个CLI工具,并希望从控制台以如下方式运行它:

$ candyapp --arg1 some-value
Run Code Online (Sandbox Code Playgroud)

我现在通过使用以下命令转到dll文件所在的位置来运行它:

$ dotnet candyapp.dll candyapp --arg1
Run Code Online (Sandbox Code Playgroud)

谁能帮助我安装应用程序并在Mac上使用它?

小智 6

使用 dotnet 应用程序的运行命令行参数。

dotnet run [-c|--configuration] [-f|--framework] [--force] [--launch-profile] [--no-build] [--no-dependencies] [--no-launch-profile] [--no-restore] [-p|--project] [--runtime] [[--] [application arguments]]
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅dotnet cli