Skip to content

Commit 334f0a2

Browse files
tdykstradsplaisted
andauthored
Document workload advertising manifest downloads (#25243)
Co-authored-by: Daniel Plaisted <[email protected]>
1 parent 0333a2a commit 334f0a2

10 files changed

+62
-11
lines changed

docs/core/tools/dotnet-build.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ In addition to its options, the `dotnet build` command accepts MSBuild options,
6666
6767
Running `dotnet build` is equivalent to running `dotnet msbuild -restore`; however, the default verbosity of the output is different.
6868

69+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
70+
6971
## Arguments
7072

7173
`PROJECT | SOLUTION`

docs/core/tools/dotnet-environment-variables.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Environment variables used by .NET SDK, .NET CLI, and .NET runtime
33
description: Learn about the environment variables that you can use to configure the .NET SDK, .NET CLI, and .NET runtime.
4-
ms.date: 07/19/2021
4+
ms.date: 07/20/2021
55
---
66
# Environment variables used by .NET SDK, .NET CLI, and .NET runtime
77

@@ -94,6 +94,14 @@ Controls diagnostics tracing from the hosting components, such as `dotnet.exe`,
9494

9595
The typical way to get detailed trace information about application startup is to set `COREHOST_TRACE=1` and`COREHOST_TRACEFILE=host_trace.txt` and then run the application. A new file `host_trace.txt` will be created in the current directory with the detailed information.
9696

97+
## DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE
98+
99+
Disables background download of advertising manifests for workloads. Default is `false` - not disabled. If set to `true`, downloading is disabled. For more information, see [Advertising manifests](dotnet-workload-install.md#advertising-manifests).
100+
101+
## DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_INTERVAL_HOURS
102+
103+
Specifies the minimum number of hours between background downloads of advertising manifests for workloads. Default is `24` - no more frequently than once a day. For more information, see [Advertising manifests](dotnet-workload-install.md#advertising-manifests).
104+
97105
## See also
98106

99107
- [dotnet command](dotnet.md)

docs/core/tools/dotnet-pack.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Web projects aren't packable by default. To override the default behavior, add t
5454

5555
[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)]
5656

57+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
58+
5759
## Arguments
5860

5961
`PROJECT | SOLUTION`

docs/core/tools/dotnet-publish.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ For more information, see the following resources:
8484
- [Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment](/aspnet/core/host-and-deploy/visual-studio-publish-profiles)
8585
- [dotnet msbuild](dotnet-msbuild.md)
8686

87+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
88+
8789
## Arguments
8890

8991
- **`PROJECT|SOLUTION`**

docs/core/tools/dotnet-restore.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ There are three specific settings that `dotnet restore` ignores:
7575

7676
Support for cross-platform package signature verification was added in the .NET 5.0.100 SDK.
7777

78+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
79+
7880
## Arguments
7981

8082
- **`ROOT`**

docs/core/tools/dotnet-run.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ To run the application, the `dotnet run` command resolves the dependencies of th
4848

4949
[!INCLUDE[dotnet restore note + options](~/includes/dotnet-restore-note-options.md)]
5050

51+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
52+
5153
## Options
5254

5355
<!-- markdownlint-disable MD012 -->

docs/core/tools/dotnet-test.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: dotnet test command
33
description: The dotnet test command is used to execute unit tests in a given project.
4-
ms.date: 04/29/2020
4+
ms.date: 07/20/2021
55
---
66
# dotnet test
77

@@ -48,6 +48,8 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework.
4848

4949
[!INCLUDE[dotnet restore note](~/includes/dotnet-restore-note.md)]
5050

51+
[!INCLUDE [cli-advertising-manifests](../../../includes/cli-advertising-manifests.md)]
52+
5153
## Arguments
5254

5355
- **`PROJECT | SOLUTION | DIRECTORY | DLL`**

docs/core/tools/dotnet-workload-install.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: dotnet workload install command
33
description: The 'dotnet workload install' command installs optional workloads.
4-
ms.date: 07/08/2021
4+
ms.date: 07/20/2021
55
---
66
# dotnet workload install
77

@@ -14,7 +14,7 @@ ms.date: 07/08/2021
1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet workload install <WORKLOAD_ID>
17+
dotnet workload install <WORKLOAD_ID>...
1818
[--configfile <FILE>] [--disable-parallel]
1919
[--download-to-cache <CACHE>] [--from-cache <CACHE>]
2020
[--ignore-failed-sources] [--include-previews] [--interactive]
@@ -26,21 +26,44 @@ dotnet workload install -?|-h|--help
2626

2727
## Description
2828

29-
The `dotnet workload install` command installs an *optional workload*. Optional workloads can be installed on top of the .NET SDK to provide support for various application types, such as [.NET MAUI](/dotnet/maui/what-is-maui) and [Blazor WebAssembly AOT](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#blazor-webassembly-ahead-of-time-aot-compilation).
29+
The `dotnet workload install` command installs one or more *optional workloads*. Optional workloads can be installed on top of the .NET SDK to provide support for various application types, such as [.NET MAUI](/dotnet/maui/what-is-maui) and [Blazor WebAssembly AOT](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#blazor-webassembly-ahead-of-time-aot-compilation).
3030

3131
Use [dotnet workload search](dotnet-workload-search.md) to learn what workloads are available to install.
3232

33-
The `dotnet workload install` command installs workload packs, which are packaged and hosted on Nuget.org. For macOS and Linux SDK installations that are installed to a protected directory, the command needs to run elevated. On Windows the command doesn't need to run elevated even if the SDK is installed to the *Program Files* directory. For Windows the command uses MSI installers for that location.
33+
### When to run elevated
3434

35-
The `dotnet workload` commands operate in the context of specific SDK versions. Suppose you have both .NET 6.0.100 SDK and .NET 7.0.100 SDK installed. The `dotnet workload` commands will give different results depending on which SDK version you select. This behavior applies to major and minor version and feature band differences, not to patch version differences. For example, .NET SDK 6.0.101 and 6.0.102 give the same results, whereas 6.0.100 and 6.0.200 give different results.
35+
For macOS and Linux SDK installations that are installed to a protected directory, the command needs to run elevated (use the `sudo` command). On Windows, the command doesn't need to run elevated even if the SDK is installed to the *Program Files* directory. For Windows, the command uses MSI installers for that location.
3636

37-
The commands provide the `--sdk-version` option to let you select an SDK version other than the one selected by default or by *global.json*.
37+
### Results vary by SDK version
38+
39+
The `dotnet workload` commands operate in the context of specific SDK versions. Suppose you have both .NET 6.0.100 SDK and .NET 6.0.200 SDK installed. The `dotnet workload` commands will give different results depending on which SDK version you select. This behavior applies to major and minor version and feature band differences, not to patch version differences. For example, .NET SDK 6.0.101 and 6.0.102 give the same results, whereas 6.0.100 and 6.0.200 give different results. You can specify the SDK version by using the [*global.json* file](global-json.md) or the `--sdk-version` option of the `dotnet workload` commands.
40+
41+
### Advertising manifests
42+
43+
The names and versions of the assets that a workload installation requires are maintained in *manifests*. By default, the `dotnet workload install` command downloads the latest available manifests before it installs a workload. The local copy of a manifest then provides the information needed to find and download the assets for a workload.
44+
45+
The `dotnet workload list` command compares the versions of installed workloads with the currently available versions. When it finds that a version newer than the installed version is available, it advertises that fact in the command output. These newer-version notifications in `dotnet workload list` are available starting in .NET 6 Preview 7.
46+
47+
To enable these notifications, the latest available versions of the manifests are downloaded and stored as *advertising manifests*. These downloads happen asynchronously in the background when any of the following commands are run.
48+
49+
* [dotnet build](dotnet-build.md)
50+
* [dotnet pack](dotnet-pack.md)
51+
* [dotnet publish](dotnet-publish.md)
52+
* [dotnet restore](dotnet-restore.md)
53+
* [dotnet run](dotnet-run.md)
54+
* [dotnet test](dotnet-test.md)
55+
56+
If a command finishes before the manifest download finishes, the download is stopped. The download is tried again the next time one of these commands is run. You can set environment variables to [disable these background downloads](dotnet-environment-variables.md#dotnet_cli_workload_update_notify_disable) or [control their frequency](dotnet-environment-variables.md#dotnet_cli_workload_update_notify_interval_hours). By default, they don't happen more than once a day.
57+
58+
You can prevent the `dotnet workload install` command from doing manifest downloads by using the `--skip-manifest-update` option.
59+
60+
The `dotnet workload update` command also downloads advertising manifests. The downloads are required to learn if an update is available, so there is no option to prevent them from running. However, you can use the `--advertising-manifests-only` option to skip workload updates and only do the manifest downloads. This option is available starting in .NET 6 Preview 7.
3861

3962
## Arguments
4063

41-
- **`WORKLOAD_ID`**
64+
- **`WORKLOAD_ID`...**
4265

43-
The workload ID of the workload to install. Use [dotnet workload search](dotnet-workload-search.md) to learn what workloads are available to install.
66+
The workload ID or multiple IDs to install. Use [dotnet workload search](dotnet-workload-search.md) to learn what workloads are available.
4467

4568
## Options
4669

docs/core/tools/dotnet-workload-update.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: dotnet workload update command
33
description: The 'dotnet workload update' command updates installed workloads.
4-
ms.date: 07/08/2021
4+
ms.date: 07/20/2021
55
---
66
# dotnet workload update
77

@@ -15,6 +15,7 @@ ms.date: 07/08/2021
1515

1616
```dotnetcli
1717
dotnet workload update
18+
[--advertising-manifests-only]
1819
[--configfile <FILE>] [--disable-parallel]
1920
[--download-to-cache <CACHE>] [--from-cache <CACHE>]
2021
[--from-previous-sdk] [--ignore-failed-sources]
@@ -35,6 +36,10 @@ For more information about the `dotnet workload` commands, see the [dotnet workl
3536

3637
<!-- markdownlint-disable MD012 -->
3738

39+
- **`--advertising-manifests-only`**
40+
41+
Downloads [advertising manifests](dotnet-workload-install.md#advertising-manifests) but doesn't update any workloads. Available starting in .NET 6 Preview 7.
42+
3843
[!INCLUDE [config-file](../../../includes/cli-configfile.md)]
3944

4045
- **`--disable-parallel`**
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Workload manifest downloads
2+
3+
When you run this command, it initiates an asynchronous background download of advertising manifests for workloads. If the download is still running when this command finishes, the download is stopped. For more information, see [Advertising manifests](../docs/core/tools/dotnet-workload-install.md#advertising-manifests).

0 commit comments

Comments
 (0)