Home  >  Article  >  Backend Development  >  .NET Core CLI tool documentation dotnet-install script reference

.NET Core CLI tool documentation dotnet-install script reference

高洛峰
高洛峰Original
2016-11-21 15:29:261660browse

Name

dotnet-install.ps1 | dotnet-install.sh - Script and shared runtime for installing command line interface (CLI) tools

Summary

Windows:

dotnet-install.ps1 [-Channel] [-Version] [-InstallDir] [-Debug] [-NoPath] [-SharedRuntime]

OS X/Linux:

dotnet-install.sh [--channel] [--version] [--install-dir ] [--debug] [--no-path] [--shared-runtime]

Description

The dotnet-install installation script is used to execute non-administrator installation of the CLI toolchain and shared runtime. You can download the script from our CLI GitHub repo.

It is mainly used to help automation scenarios and non-administrator installations. There are two scripts, one is PowerShell that works on Windows and another bash script that works on Linux/OS X. Both of them have the same behavior. Bash scripts also "understand" PowerShell switches, so you can use them across the board.

The installation script will be generated by downloading the ZIP/tarball (compressed package) file from the CLI, and will be installed in the default location or in the location specified by --install-dir. By default, the installation script will download the SDK and install it; if you just want to get the shared runtime, you can specify the --shared-runtime parameter.

By default, the installation script adds the installation location to the $PATH of the current session. This can be overridden if the --no-path parameter is used.

Please install all required dependencies before running the script.

You can use the --version parameter to install a specific version. The specified version requires a 3-part version (for example: 1.0.0-13232). If omitted, it will default to the first global.json file containing an sdkVersion node found in the called script's parent folder. If it doesn't exist, it will use the latest one.

You can also use this script to get debug binaries of SDK or shared runtime debugging symbols by using the --debug parameter. If you don't do this the first time you install it, and later on you actually do need the debugging symbols, you can rerun the script with this parameter and the version you installed.

Options

Options for different script implementations.

PowerShell (Windows)

-Channel [CHANNEL]

The channel to install (for example: "future", "preview", "production"). The default version is "Production".

-Version [VERSION]

The installed CLI version. You need to specify the 3-part version (for example: 1.0.0-13232). If omitted, it will default to the first global.json file containing an sdkVersion node found in the called script's parent folder. If it doesn't exist, it will use the latest one.

-InstallDir [DIR]

The installation path. Create the directory if it does not exist. The default value is %LocalAppData%.dotnet.

-Debug

true indicates that a larger package containing debugging symbols should be used; otherwise, false. The default value is false.

-NoPath

true indicates that the prefix/installation directory is not exported to the path of the current session; otherwise, false. The default value is false, that is, PATH is modified. This makes the CLI tool available immediately after installation.

-SharedRuntime

true only installs the shared runtime. false installs the entire SDK. The default value is false.

Bash (OS The default version is "Production".

--version [VERSION]

The installed CLI version. You need to specify the 3-part version (for example: 1.0.0-13232). If omitted, it will default to the first global.json file containing an sdkVersion node. If it doesn't exist, it will use the latest one.

--install-dir [DIR]

The installation path. Create the directory if it does not exist. The default value is %HOME%/.dotnet.

--debug

true indicates that a larger package containing debugging symbols should be used; otherwise, false . The default value is false.

--no-path

true indicates that the prefix/installation directory is not exported to the path of the current session; otherwise, false. The default value is false, that is, PATH is modified. This makes the CLI tool available immediately after installation.

--shared-runtime

true only installs the shared runtime. false installs the entire SDK. The default value is false.

Example

Windows:

./dotnet-install.ps1 -Channel Future

OS X/Linux:


./dotnet-install.sh --channel Future

Install the latest development version to default Location.


Windows:

./dotnet-install.ps1 -Channel preview -InstallDir C:cli

OS X/Linux:


./dotnet-install.sh --channel preview --install-dir ~ /cli

Install the latest preview version to the specified location.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn