This guide will show you
- how to manually setup Paket in your .NET and Mono solutions
- and how to use the automatic NuGet conversion.
The following guide is assuming you are using the
paket.execommand line tool. For information on installing the command line tool follow the instructions for your operating system for installation. There are editor plugins for Visual Studio, Atom and other which can make this process easier and provide additional tooling like syntax highlighting. Check our editor support page to see if your editor has a Paket plugin. If you are starting a new solution from scratch then take a look at ProjectScaffold. This project helps you get started with a new .NET/Mono project solution with everything needed for successful organising of code, tools and publishing and includes Paket.
- Create a
.paketdirectory in the root of your solution.
Download the latest
paket.bootstrapper.exeinto that directory.
.paket/paket.exe. Read more about "magic mode".
.paket/paket.exeto your repository.
After the first
.paket/paket.exeinvocation Paket will create a couple of files in
.paket— commit those as well.
Configure your source control system to ignore the
paket-filesfolder, for example in Git add a line to the
The file might look like this:
1: 2: 3: 4: 5: 6:
Read more about the importance and the structure of the
This file should be committed to your version control system.
Install all required packages from the specified sources:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
Read more about the the
paket.lock file. This file should be
committed to your version control system.
In the last paragraph you learned how to install packages into your repository,
but usually you want to use the dependencies in your C#, VB or F# projects. In
order to do so you need a
alongside your Visual Studio project files. By listing the direct dependencies
paket.references file, Paket will automatically
sync references to the corresponding projects whenever an
update takes place.
1: 2: 3: 4:
Don't forget to run
install again in order to let Paket
reference the dependencies in your projects:
If you want to check if your dependencies have updates you can run the
paket outdated command:
If you want to update all packages you can use the
paket update command:
If you are already using NuGet and want to learn how to use the automatic NuGet conversion, then read the next tutorial.
The most frequently used Paket commands are:
paket installcommand which you should run after modifying the
paket.dependenciesfile. This command will update the
paket.lockfile, then update all of your Visual Studio projects to the new versions.
paket restorecommand which you should run after cloning the repository or switching branches. This command will take the current
paket.lockfile and update your Visual Studio projects so that they are referencing the correct versions of NuGet packages. If you are using a continuous integration system like TeamCity or Jenkins then you should also run this command after getting the source code and before compiling it.
paket updatecommand which you can run to update your project to the latest versions of all dependent packages. This command will update the
paket.lockfile to reference the most recent versions permitted by the restrictions in
paket.dependencies, then apply these changes to your Visual Studio projects.