我正在尝试使用以下命令将命令行参数传递-p给我的 .NET Core 应用程序dotnet run。dotnet run -p /Users/user/Pictures但是,当我这样做时,我收到如下错误消息。它看起来像是dotnet run试图打开一个项目文件夹,而不是将此参数传递给我的应用程序。我可以将其他内容(例如 )传递-q给我的应用程序。
-p使用时如何传递到我的应用程序dotnet run?
错误是这样的:
$ dotnet run -p /Users/user/Pictures
MSBUILD : error MSB1001: Unknown switch.
Switch: /Users/user/Pictures
For switch syntax, type "MSBuild -help"
The build failed. Fix the build errors and run again.
Run Code Online (Sandbox Code Playgroud)
我正在尝试编写一个带有如下开关的 .NET 应用程序:
Usage: du [-s] [-p] [-b] "path"
Summarize disk usage of the set of FILES, recursively for directories.
You MUST specify one of …Run Code Online (Sandbox Code Playgroud)