1(1)                                  .NET                                  (1)
2
3
4

dotnet-install scripts reference

NAME

7       dotnet-install.ps1  |  dotnet-install.sh  -  Script used to install the
8       .NET SDK and the shared runtime.
9

SYNOPSIS

11       Windows:
12
13              dotnet-install.ps1 [-Architecture <ARCHITECTURE>] [-AzureFeed]
14                  [-Channel <CHANNEL>] [-DryRun] [-FeedCredential]
15                  [-InstallDir <DIRECTORY>] [-JSonFile <JSONFILE>]
16                  [-NoCdn] [-NoPath] [-ProxyAddress] [-ProxyBypassList <LIST_OF_URLS>]
17                  [-ProxyUseDefaultCredentials] [-Quality <QUALITY>] [-Runtime <RUNTIME>]
18                  [-SkipNonVersionedFiles] [-UncachedFeed] [-Verbose]
19                  [-Version <VERSION>]
20
21              Get-Help ./dotnet-install.ps1
22
23       Linux/macOS:
24
25              dotnet-install.sh  [--architecture <ARCHITECTURE>] [--azure-feed]
26                  [--channel <CHANNEL>] [--dry-run] [--feed-credential]
27                  [--install-dir <DIRECTORY>] [--jsonfile <JSONFILE>]
28                  [--no-cdn] [--no-path] [--quality <QUALITY>]
29                  [--runtime <RUNTIME>] [--runtime-id <RID>]
30                  [--skip-non-versioned-files] [--uncached-feed] [--verbose]
31                  [--version <VERSION>]
32
33              dotnet-install.sh --help
34
35       The bash script also reads PowerShell switches, so you can  use  Power‐
36       Shell switches with the script on Linux/macOS systems.
37

DESCRIPTION

39       The dotnet-install scripts perform a non-admin installation of the .NET
40       SDK, which includes the .NET CLI and the shared runtime.  There are two
41       scripts:
42
43       • A PowerShell script that works on Windows.
44
45       • A bash script that works on Linux/macOS.
46
47         [!NOTE]  .NET  collects telemetry data.  To learn more and how to opt
48         out, see .NET SDK telemetry.
49
50   Purpose
51       The intended use of the scripts is for Continuous Integration (CI) sce‐
52       narios, where:
53
54       • The  SDK  needs  to be installed without user interaction and without
55         admin rights.
56
57       • The SDK installation doesn’t need to persist across multiple CI runs.
58
59         The typical sequence of events:
60
61         • CI is triggered.
62
63         • CI installs the SDK using one of these scripts.
64
65         • CI finishes its work and clears temporary data  including  the  SDK
66           installation.
67
68       To  set up a development environment or to run apps, use the installers
69       rather than these scripts.
70
71   Recommended version
72       We recommend that you use the stable version of the scripts:
73
74       • Bash (Linux/macOS): <https://dot.net/v1/dotnet-install.sh>
75
76       • PowerShell (Windows): <https://dot.net/v1/dotnet-install.ps1>
77
78   Script behavior
79       Both scripts have the same behavior.   They  download  the  ZIP/tarball
80       file  from  the CLI build drops and proceed to install it in either the
81       default location or in a location specified  by  -InstallDir|--install-
82       dir.
83
84       By  default,  the installation scripts download the SDK and install it.
85       If you wish to only  obtain  the  shared  runtime,  specify  the  -Run‐
86       time|--runtime argument.
87
88       By  default,  the script adds the install location to the $PATH for the
89       current session.  Override this  default  behavior  by  specifying  the
90       -NoPath|--no-path argument.  The script doesn’t set the DOTNET_ROOT en‐
91       vironment variable.
92
93       Before running the script, install the required dependencies.
94
95       You can install a specific version using the  -Version|--version  argu‐
96       ment.   The  version  must be specified as a three-part version number,
97       such as 2.1.0.  If the version isn’t specified, the script installs the
98       latest version.
99
100       The  install  scripts do not update the registry on Windows.  They just
101       download the zipped binaries and copy them to a folder.   If  you  want
102       registry key values to be updated, use the .NET installers.
103

OPTIONS

105-Architecture|--architecture <ARCHITECTURE>
106
107         Architecture  of  the  .NET binaries to install.  Possible values are
108         <auto>, amd64, x64, x86, arm64, and arm.  The default value  is  <au‐
109         to>, which represents the currently running OS architecture.
110
111-AzureFeed|--azure-feed
112
113         Specifies the URL for the Azure feed to the installer.  We recommend‐
114         ed  that  you  don’t  change  this  value.   The  default  value   is
115         https://dotnetcli.azureedge.net/dotnet.
116
117-Channel|--channel <CHANNEL>
118
119         Specifies the source channel for the installation.  The possible val‐
120         ues are:
121
122         • Current - Most current release.
123
124         • LTS - Long-Term Support channel (most current supported release).
125
126         • Two-part version in A.B format,  representing  a  specific  release
127           (for example, 2.1 or 3.0).
128
129         • Three-part  version  in A.B.Cxx format, representing a specific SDK
130           release (for example, 5.0.1xx or 5.0.2xx).  Available since the 5.0
131           release.
132
133         The  version  parameter overrides the channel parameter when any ver‐
134         sion other than latest is used.
135
136         The default value is LTS.  For more information on .NET support chan‐
137         nels, see the .NET Support Policy (https://dotnet.microsoft.com/plat
138         form/support/policy/dotnet-core) page.
139
140-DryRun|--dry-run
141
142         If set, the script won’t perform the installation.  Instead, it  dis‐
143         plays  what command line to use to consistently install the currently
144         requested version of the .NET CLI.  For example, if you specify  ver‐
145         sion  latest,  it  displays  a link with the specific version so that
146         this command can be used deterministically in a build script.  It al‐
147         so  displays  the binary’s location if you prefer to install or down‐
148         load it yourself.
149
150-FeedCredential|--feed-credential
151
152         Used as a query string to append to the Azure feed.  It allows chang‐
153         ing the URL to use non-public blob storage accounts.
154
155--help
156
157         Prints  out  help  for the script.  Applies only to bash script.  For
158         PowerShell, use Get-Help ./dotnet-install.ps1.
159
160-InstallDir|--install-dir <DIRECTORY>
161
162         Specifies the installation path.  The  directory  is  created  if  it
163         doesn’t  exist.   The  default  value is %LocalAppData%on Windows and
164         /usr/share/dotnet* on Linux/macOS.  Binaries are placed  directly  in
165         this directory.
166
167-JSonFile|--jsonfile <JSONFILE>
168
169         Specifies a path to a global.json file that will be used to determine
170         the SDK version.  The global.json file must have a value for sdk:ver‐
171         sion.
172
173-NoCdn|--no-cdn
174
175         Disables  downloading  from  the Azure Content Delivery Network (CDN)
176         and uses the uncached feed directly.
177
178-NoPath|--no-path
179
180         If set, the installation folder isn’t exported to the  path  for  the
181         current  session.   By  default,  the script modifies the PATH, which
182         makes the .NET CLI available immediately after install.
183
184-ProxyAddress
185
186         If set, the installer uses the proxy when making web requests.  (Only
187         valid for Windows.)
188
189-ProxyBypassList <LIST_OF_URLS>
190
191         If  set  with  ProxyAddress,  provides a list of comma-separated urls
192         that will bypass the proxy.  (Only valid for Windows.)
193
194ProxyUseDefaultCredentials
195
196         If set, the installer uses the credentials of the current  user  when
197         using proxy address.  (Only valid for Windows.)
198
199-Quality|--quality <QUALITY>
200
201         Downloads  the  latest build of the specified quality in the channel.
202         The possible values  are:  daily,  signed,  validated,  preview,  GA.
203         Works  only  in combination with channel.  Not applicable for current
204         and LTS channels and will be ignored if  one  of  those  channels  is
205         used.
206
207         For an SDK installation, use channel in A.B or A.B.Cxx format.  For a
208         runtime installation, use channel in A.B format.
209
210         The version parameter overrides the channel  and  quality  parameters
211         when any version other than latest is used.
212
213         Available since since the 5.0 release.
214
215-Runtime|--runtime <RUNTIME>
216
217         Installs  just  the shared runtime, not the entire SDK.  The possible
218         values are:
219
220         • dotnet - the Microsoft.NETCore.App shared runtime.
221
222         • aspnetcore - the Microsoft.AspNetCore.App shared runtime.
223
224         • windowsdesktop - the Microsoft.WindowsDesktop.App shared runtime.
225
226--runtime-id <RID> [Deprecated]
227
228         Specifies the runtime identifier for which the tools  are  being  in‐
229         stalled.   Use  linux-x64  for  portable Linux.  (Only valid for Lin‐
230         ux/macOS and for versions earlier than .NET Core 2.1.)
231
232         --os <OPERATING_SYSTEM>
233
234         Specifies the operating system for which  the  tools  are  being  in‐
235         stalled.   Possible  values  are:  osx,  linux,  linux-musl, freebsd,
236         rhel.6.  (Valid for .NET Core 2.1 and later.)
237
238         The parameter is optional and should only be used when it’s  required
239         to override the operating system that is detected by the script.
240
241-SharedRuntime|--shared-runtime
242
243                [!NOTE] This parameter is obsolete and may be removed in a fu‐
244                ture version of the script.  The  recommended  alternative  is
245                the -Runtime|--runtime option.
246
247         Installs  just the shared runtime bits, not the entire SDK.  This op‐
248         tion is equivalent to specifying -Runtime|--runtime dotnet.
249
250-SkipNonVersionedFiles|--skip-non-versioned-files
251
252         Skips installing non-versioned files, such as dotnet.exe, if they al‐
253         ready exist.
254
255-UncachedFeed|--uncached-feed
256
257         Allows changing the URL for the uncached feed used by this installer.
258         We recommended that you don’t change this value.
259
260-Verbose|--verbose
261
262         Displays diagnostics information.
263
264-Version|--version <VERSION>
265
266         Represents a specific build version.  The possible values are:
267
268         • latest - Latest build on the channel (used with  the  -Channel  op‐
269           tion).
270
271         • Three-part  version  in  X.Y.Z format representing a specific build
272           version; supersedes the -Channel option.  For  example:  2.0.0-pre‐
273           view2-006120.
274
275         If not specified, -Version defaults to latest.
276

EXAMPLES

278       • Install  the  latest long-term supported (LTS) version to the default
279         location:
280
281         Windows:
282
283                ./dotnet-install.ps1 -Channel LTS
284
285         macOS/Linux:
286
287                ./dotnet-install.sh --channel LTS
288
289       • Install the latest preview version of the 6.0.1xx SDK to  the  speci‐
290         fied location:
291
292         Windows:
293
294                ./dotnet-install.ps1 -Channel 6.0.1xx -Quality preview -InstallDir C:\cli
295
296         macOS/Linux:
297
298                ./dotnet-install.sh --channel 6.0.1xx --quality preview --install-dir ~/cli
299
300       • Install the 3.0.0 version of the shared runtime:
301
302         Windows:
303
304                ./dotnet-install.ps1 -Runtime dotnet -Version 3.0.0
305
306         macOS/Linux:
307
308                ./dotnet-install.sh --runtime dotnet --version 3.0.0
309
310       • Obtain  script and install the 2.1.2 version behind a corporate proxy
311         (Windows only):
312
313                Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -Proxy $env:HTTP_PROXY -ProxyUseDefaultCredentials -OutFile 'dotnet-install.ps1';
314                ./dotnet-install.ps1 -InstallDir '~/.dotnet' -Version '2.1.2' -ProxyAddress $env:HTTP_PROXY -ProxyUseDefaultCredentials;
315
316       • Obtain script and install .NET CLI one-liner examples:
317
318         Windows:
319
320                # Run a separate PowerShell process because the script calls exit, so it will end the current PowerShell session.
321                &powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) <additional install-script args>"
322
323         macOS/Linux:
324
325                curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin <additional install-script args>
326
327   See also
328       • .NET releases (https://github.com/dotnet/core/releases)
329
330       • .NET  Runtime  and  SDK  download  archive   (https://github.com/dot
331         net/core/tree/main/release-notes/download-archives)
332
333
334
335                                                                           (1)
Impressum