Logo Paket

Paket installation

This guide will show you

Paket is a .NET tool: it needs the .NET SDK and runs on Windows, Linux and macOS. It manages the dependencies of any project, including the projects that target the .NET Framework.

Local tool

A local tool pins the version of Paket for the repository, so that everyone and every build server uses the same one. In the root of the repository:

dotnet new tool-manifest

dotnet tool install paket

Don't forget to commit .config/dotnet-tools.json to your source control. After a clone, run dotnet tool restore to install the tools it lists, then run Paket with:

dotnet paket --help

Global tool

A global tool puts the paket command on your PATH, for every repository of your machine:

dotnet tool install --global paket

You can also install Paket into a folder of the repository, and run it from there:

dotnet tool install paket --tool-path .paket

Paket.Restore.targets and paket.targets find Paket when it is installed with --tool-path in .paket or in the root of the repository, as a local tool, or on the PATH, in that order.

Solutions without the .NET SDK

The projects that use the .NET SDK restore their packages through Paket.Restore.targets, which paket install adds to them. For the other projects, such as the projects of a .NET Framework solution built by Visual Studio, run:

dotnet paket auto-restore on

It writes .paket/paket.targets and imports it into those projects, so that they run paket restore before their build. Commit .paket/paket.targets as well. Paket can be a local tool, a global tool or installed with --tool-path: paket.targets finds it the same way.

Moving from paket.exe and the bootstrapper

From Paket 12.0, paket.exe and paket.bootstrapper.exe are no longer published. A bootstrapper older than 11.0 downloads a paket.exe that only explains how to move on, and fails the build. The bootstrapper of Paket 11 never goes past the 11.x releases.

To move to the .NET tool:

  1. Install Paket as a local tool in the root of the repository.
  2. Delete .paket/paket.exe, .paket/paket.exe.config and .paket/paket.bootstrapper.exe, and remove the version line from paket.dependencies if there is one: only the bootstrapper read it.
  3. In your build scripts, run dotnet tool restore before Paket, and replace .paket/paket.exe with dotnet paket (without mono in front of it).
  4. If you use paket auto-restore, run dotnet paket auto-restore on again to update .paket/paket.targets.

To keep paket.exe for now, move to the bootstrapper of Paket 11, which stays on the latest 11.x:

  1. Remove the version line from paket.dependencies if there is one: with it, the bootstrapper downloads exactly that version, and --self the bootstrapper of that version.
  2. Run .paket/paket.bootstrapper.exe --self.

If .paket/paket.exe is the bootstrapper itself (magic mode), replace it with the bootstrapper of the latest release, which is the one of Paket 11.

Post installation

Once the basic installation is complete it is often very useful to add some tools to your shell/IDE/Text Editor of choice.

For next steps check out the Getting Started section.

Type something to start searching.