Get started
This guide shows how to get started with Paket in various ways, depending on your scenario:
- Get started with .NET Core (preferred)
- Get started with the paket bootstrapper (legacy)
- Convert from legacy NuGet
.NET Core (preferred)
Paket works entirely out of the box on .NET Core, and it's simple to get started.
-
Install .NET Core 3.0 or higher
If you don't have it already, you'll need to download and install the latest .NET Core.
-
Install and restore Paket as a local tool in the root of your codebase:
1: 2: 3:
dotnet new tool-manifest dotnet tool install paket dotnet tool restore
This will create a
.config/dotnet-tools.json
file in the root of your codebase. It must be checked into source control. -
Initialize Paket by creating a dependencies file.
1:
dotnet paket init
If you have a build.sh
/build.cmd
build script, also make sure you add the last two commands before you execute your build:
1: 2: 3: |
|
This will ensure Paket works in any .NET Core build environment.
Make sure to add the following entry to your .gitignore
:
1: 2: |
|
Next, learn how to use Paket
Install the Paket bootstrapper (legacy)
If you're not using .NET Core, or you're stuck on .NET Core 2.2 or lower, you can use the paket bootstrapper.
- Create a
.paket
directory in the root of your solution. - Download the latest
paket.bootstrapper.exe
into that directory. - Rename
.paket/paket.bootstrapper.exe
to.paket/paket.exe
. Read more about "magic mode". - Commit
.paket/paket.exe
to your repository. -
After the first
.paket/paket.exe
invocation Paket will create a couple of files in.paket
— commit those as well.
Make sure to add the following entries to your .gitignore
:
1: 2: 3: |
|
Next, learn how to use Paket
Convert from NuGet
If you are using legacy NuGet (packages.config
-style), then check out the tutorial on how to automatically convert from legacy nuget.