Skip to content

Commit

Permalink
docs: add note about PackageDownload in global builds
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Jun 13, 2024
1 parent 0f3d530 commit 5d4b16b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/04-sharing/01-global-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,22 @@ As a first step, you need to extend the build project file with the [necessary i
</Project>
```

Afterwards, the project can be packaged and deployed as usual:
:::warning
Note that `PackageDownload` can only be used in the .NET global tool project directly, since they [do not work transitively](https://github.com/NuGet/Home/wiki/%5BSpec%5D-PackageDownload-support#package-declaration). Alternatively, you can reference tools the old way via `PackageReference` and set the `ExcludeAssets` property:

```xml
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="NUnit.ConsoleRunner" Version="3.9.0" ExcludeAssets="all" />
</ItemGroup>

</Project>
```

:::

Afterward, the project can be packaged and deployed as usual:

```powershell
# terminal-command
Expand Down

0 comments on commit 5d4b16b

Please sign in to comment.