This video covers how to install and set up Paket.
- [Instructor] Paket is one of the coolest projects to come out of .NET. So, what is it? It's a package dependency manager for .NET It sits on top of NuGet and fixes many of the errors and issues NuGet has. First, one of the smaller ones. NuGet doesn't separate transitive dependencies. So, if one of the dependencies that you explicitly add has a dependency, there isn't a good way to call out which is which in your dependency list. NuGet, in general, will lump them all together in your packages list. Paket, however, is able to handle that easily.
They use separate files. First, there's a Paket.References file for each project. Here, you'll list the individual references needed for that project. Next, there's a Paket.Dependencies file for each solution. This will list all the dependencies that you're adding for the entire project. Finally, there's a Paket.Lock file, which is generated, and includes all dependencies contained in the project including the transitive dependencies. In this example, Newtonsoft.Json as a transitive dependency is indented. So, it's clear which dependencies you did not explicitly add.
Another reason many people switch to Paket is that they don't keep the package version in the file path. This is especially useful for Fsharp script files. When you add a reference from a script file, you often need to fully qualify the path, which means that your script will break every time you need to update a reference. As you can see at the bottom, here, Paket doesn't have the package version as part of the folder name. Paket also fully supports semantic versioning. Semantic versioning is a set of strict guidelines around versioning to provide consistency to the industry and following it helps give more meaning to a project's version numbers.
Basically, you set up your version number to increment the Major version when you make backwards, incompatible changes, the Minor version, when you add backwards-compatible changes, and the Patch version when you make backwards-compatible bug fixes. So, something like 1.0.2, means that it's the first Major version and there have been two bug fixes since release. NuGet may never fully support version 2.0 of semantic versioning, which includes labels for pre-release and build metadata such as Plus Alpha. With Paket, updating a framework version is super easy.
NuGet downloads only the current, relevant framework files upon install, whereas Paket downloads every version available. Then, the correct version is chosen using attributes. You don't need to remember to reinstall packages on updating the framework version. Finally, it's possible to reference a repository from GitHub or even just a single file. You can also reference a gist or a file from the web. While this isn't always advised, there are some cases where it is very much a lifesaver. We'll be using Paket for this course and highly recommended it in general for all your .NET development.
- Developing in F#
- Developing in Xamarin
- Developing in XAML
- Using Paket
- Creating an application
- Adding buttons and views
- Asynchronous workflows
- Adding a mailbox processor to an app
- Modifying the core code
- Adding a reply feature to an app