Introduction to Paket and introduction to paket
A hot topic in the. NET community outside of China is Packet (https://fsprojects.github.io/Paket/index.html), which is essentially another way to manage. NET projects outside of Nuget.
The question is, why should we replace NuGet?
Packet is basically an alternative tool for NuGet, so you are sure to know, "Why do we need to replace NuGet? "Packet essentially only requires the most basic NuGet functions and adds some additional and nice features.
On the one hand, Paket enables you to precisely control what happens to the package dependency of your project. If different packages reference the same dependent package of different versions, such as log4net, there are no more conflicts between them.
Another cool thing is that Paket can reference a single file http://fsprojects.github.io/Paket/github-dependencies.html on GitHub, that is, it can work well with Github.
So I am already using NuGet?
No problem! Paket has a beautiful Conversion Tool convert-from-nuget to help you complete this conversion.
So how can we get started? Come with me.
First, you must include a. paket.exe file in the root directory of your solution.
After the folder and file content are both there, you need to create a paket. dependencies file under the root directory of the solution. The content is similar:
Source https://nuget.org/api/v2
Nuget FSharp. Core ~> 3.1.2
Nuget FSharp. Formatting
Nuget Nuget. CommandLine
Nuget FAKE
Nuget SourceLink. Fake
Nuget IKVM ~> 8.0.5
Nuget NUnit
Nuget NUnit. Runners
Github fsharp/FAKE modules/Octokit. fsx
This file tells PAKET that the source is the package/file name (on NuGet or GitHub), which can be downloaded from these sources.
You can use a build.exe file or execute paket.exe as follows.
\. Paket \ paket.exe install
This will create a packages folder, which will include all the libraries.
From here, you can manually reference the library you want at any time, but PAKET makes this work easier. A paket. references file is located in the folder of each project file to create a library that contains the file to be referenced.
FSharp. Core
NUnit
NUnit. Runners
Note that FAKE is not in the file because it will not be referenced. The paket. references file will only be added to the lib folder if the fruit library is in the project. Manual reference is not a problem because it can be manually referenced in the build. fsx file. To enable PAKET to use the reference file, you only need to -- hard to re-run the installation command.
\. Paket \ paket.exe install-hard
This will check the paket. references file and use this file to automatically reference the library corresponding to the project.
There is also a plug-in tool https://github.com/hmemcpy/Paket.VisualStudio for Visual Studio, but only supports Visual studio 2013.
We hope this brief introduction will help you get started with the Paket tool that is easier than the previous package management. However, this is still a young and very active project. We look forward to your attention.