可藉由指定應用程式 DLL (例如 dotnet myapp.dll)，使用 dotnet 來執行應用程式。dotnet can be used to run applications, by specifying an application DLL, such as dotnet myapp.dll.請參閱 .NET Core 應用程式部署 來了解部署選項。See .NET Core application deployment for to learn about deployment options.

用來執行應用程式的 .NET Core 執行階段版本。Version of the .NET Core runtime to use to run the application.

-h|--help

印出指定命令的文件，例如dotnet build --help。Prints out documentation for a given command, such as dotnet build --help.dotnet --help 會印出可用命令的清單。dotnet --help prints a list of available commands.

--info

會印出關於 .NET Core 安裝和電腦環境的詳細資訊，例如目前作業系統和 .NET Core 版本的認可 SHA。Prints out detailed information about a .NET Core installation and the machine environment, such as the current operating system, and commit SHA of the .NET Core version.

--list-runtimes

顯示已安裝的 .NET Core 執行階段。Displays the installed .NET Core runtimes.

--list-sdks

顯示已安裝的 .NET Core SDK。Displays the installed .NET Core SDKs.

--roll-forward-on-no-candidate-fx <N>

在必要的共用架構無法使用時定義行為。Defines behavior when the required shared framework is not available.N 可以是：N can be:

0 - 對次要版本也停用向前復原。0 - Disable even minor version roll forward.

1 - 對次要版本向前復原，主要版本則不。1 - Roll forward on minor version, but not on major version.這是預設行為。This is the default behavior.

設定命令的詳細資訊層級。Sets the verbosity level of the command.允許的值為 q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic]。Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].不在每項命令中支援，請參考特定命令的頁面來判斷此選項是否可用。Not supported in every command; see specific command page to determine if this option is available.

--version

印出使用中的 .NET Core SDK 版本。Prints out the version of the .NET Core SDK in use.

用來執行應用程式的 .NET Core 執行階段版本。Version of the .NET Core runtime to use to run the application.

-h|--help

印出指定命令的文件，例如dotnet build --help。Prints out documentation for a given command, such as dotnet build --help.dotnet --help 會印出可用命令的清單。dotnet --help prints a list of available commands.

--info

會印出關於 .NET Core 安裝和電腦環境的詳細資訊，例如目前作業系統和 .NET Core 版本的認可 SHA。Prints out detailed information about a .NET Core installation and the machine environment, such as the current operating system, and commit SHA of the .NET Core version.

--roll-forward-on-no-candidate-fx

如果設定為 0，將停用次要版本向前復原。Disables minor version roll forward, if set to 0.如需詳細資訊，請參閱向前復原。For more information, see Roll forward.

-v|--verbosity <LEVEL>

設定命令的詳細資訊層級。Sets the verbosity level of the command.允許的值為 q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic]。Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].不在每項命令中支援，請參考特定命令的頁面來判斷此選項是否可用。Not supported in every command; see specific command page to determine if this option is available.

--version

印出使用中的 .NET Core SDK 版本。Prints out the version of the .NET Core SDK in use.

用來執行應用程式的 .NET Core 執行階段版本。Version of the .NET Core runtime to use to run the application.

-h|--help

印出指定命令的文件，例如dotnet build --help。Prints out documentation for a given command, such as dotnet build --help.dotnet --help 會印出可用命令的清單。dotnet --help prints a list of available commands.

--info

會印出關於 .NET Core 安裝和電腦環境的詳細資訊，例如目前作業系統和 .NET Core 版本的認可 SHA。Prints out detailed information about a .NET Core installation and the machine environment, such as the current operating system, and commit SHA of the .NET Core version.

-v|--verbosity <LEVEL>

設定命令的詳細資訊層級。Sets the verbosity level of the command.允許的值為 q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic]。Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].不在每項命令中支援，請參考特定命令的頁面來判斷此選項是否可用。Not supported in every command; see specific command page to determine if this option is available.

--version

印出使用中的 .NET Core SDK 版本。Prints out the version of the .NET Core SDK in use.

其他工具Additional tools

從 .NET Core SDK 2.1.300 開始，先前僅能透過 DotnetCliToolReference 於個別專案上使用的數個工具，現在皆已做為 .NET Core SDK 的一部分提供。Starting with .NET Core SDK 2.1.300, a number of tools that were available only on a per project basis using DotnetCliToolReference are now available as part of the .NET Core SDK.這些工具列於下列資料表中：These tools are listed in the following table:

範例Examples

建立新的 .NET Core 主控台應用程式：Creates a new .NET Core console application:

dotnet new console

還原所指定應用程式的相依性：Restore dependencies for a given application:

dotnet restore

注意

從 .NET Core 2.0 SDK 開始，您不需要執行 dotnet restore，因為所有需要進行還原的命令 (例如 dotnet new、dotnet build 和 dotnet run) 都會以隱含方式執行它。Starting with .NET Core 2.0 SDK, you don't have to run dotnet restore because it's run implicitly by all commands that require a restore to occur, such as dotnet new, dotnet build and dotnet run.它在執行明確還原有意義的某些情況下仍然是有效的命令，例如 Azure DevOps Services 中的持續整合組建，或在需要明確控制還原進行時間的建置系統中。It's still a valid command in certain scenarios where doing an explicit restore makes sense, such as continuous integration builds in Azure DevOps Services or in build systems that need to explicitly control the time at which the restore occurs.

建置所指定目錄中的專案和其相依性：Build a project and its dependencies in a given directory:

指定載入執行階段時，共用主機所使用的服務索引位置。Specifies the location of the servicing index to use by the shared host when loading the runtime.

DOTNET_CLI_TELEMETRY_OPTOUT

指定是否收集 .NET Core 工作使用資料，並將其傳送給 Microsoft。Specifies whether data about the .NET Core tools usage is collected and sent to Microsoft.設為 true 以選擇加入遙測功能 (可接受的值為 true、1 或 yes)。Set to true to opt-out of the telemetry feature (values true, 1, or yes accepted).否則，請設為 false 以選擇退出遙測功能 (可接受的值為 false、0 或 no)。Otherwise, set to false to opt into the telemetry features (values false, 0, or no accepted).如果未設定，預設值為 false，且遙測功能會處於作用狀態。If not set, the default is false and the telemetry feature is active.

指定載入執行階段時，共用主機所使用的服務索引位置。Specifies the location of the servicing index to use by the shared host when loading the runtime.

DOTNET_CLI_TELEMETRY_OPTOUT

指定是否收集 .NET Core 工作使用資料，並將其傳送給 Microsoft。Specifies whether data about the .NET Core tools usage is collected and sent to Microsoft.設為 true 以選擇加入遙測功能 (可接受的值為 true、1 或 yes)。Set to true to opt-out of the telemetry feature (values true, 1, or yes accepted).否則，請設為 false 以選擇退出遙測功能 (可接受的值為 false、0 或 no)。Otherwise, set to false to opt into the telemetry features (values false, 0, or no accepted).如果未設定，預設值為 false，且遙測功能會處於作用狀態。If not set, the default is false and the telemetry feature is active.

指定載入執行階段時，共用主機所使用的服務索引位置。Specifies the location of the servicing index to use by the shared host when loading the runtime.

DOTNET_CLI_TELEMETRY_OPTOUT

指定是否收集 .NET Core 工作使用資料，並將其傳送給 Microsoft。Specifies whether data about the .NET Core tools usage is collected and sent to Microsoft.設為 true 以選擇加入遙測功能 (可接受的值為 true、1 或 yes)。Set to true to opt-out of the telemetry feature (values true, 1, or yes accepted).否則，請設為 false 以選擇退出遙測功能 (可接受的值為 false、0 或 no)。Otherwise, set to false to opt into the telemetry features (values false, 0, or no accepted).如果未設定，預設值為 false，且遙測功能會處於作用狀態。If not set, the default is false and the telemetry feature is active.