In addition to being a freelance Orchard Core developer, I am also an Orchard Core trainer. I teach developer teams how to develop, maintain, and deploy professional Orchard Core websites, themes, and modules. As such, I have developed 100's of custom Orchard Core samples to showcase Orchard Core development techniques and best practices. I use these samples as part of my Orchard Core training and it's important that they are up-to-date and demonstrate the latest techniques.
Since Orchard Core is still in preview and constantly being updated with bug fixes and new features, the Orchard Core NuGet packages used by these custom modules, themes, and websites are constantly becoming outdated. When I become aware of a new Orchard Core feature, bug fix, or best practice, I update the necessary samples, and part of this update includes updating any outdated NuGet packages.
It's pretty easy to update all the Orchard Core NuGet packages from within certain IDE's like Visual Studio and JetBrains Rider. Visual Studio has an option to Manage NuGet Packages. When choosing the Manage NuGet Packages option in Visual Studio you can select the Updates tab, select all, and update all the Orchard Core NuGet packages. JetBrains Rider has similar functionality that makes updating NuGet packages a breeze. Simply navigate to the NuGet Window in JetBrains Rider and click the option to Upgrade all packages in Solution.
However, most of the time I wish to update all of the outdated Orchard Core NuGet packages from the command line. And almost always, I am not picking and choosing which Orchard Core packages to update, I want all the outdated Orchard Core packages to update to their most recent pre-release version with one quick command. Luckily there is a tool that you can install to update all the outdated NuGet packages for Orchard Core or any .NET Core project you're working on- the dotnet-outdated tool.
If you're an Orchard Core developer constantly working with the latest pre-release bits of Orchard Core in the GitHub development branch, you will appreciate the dotnet-outdated tool for quickly upgrading your Orchard Core NuGet packages to the latest version.
First thing you need to do is install the dotnet-outdated tool.
$ dotnet tool install --global dotnet-outdated-tool
Once installed, navigate to your Orchard Core project folder and tell dotnet-outdated to update all those Orchard Core NuGet packages that have become outdated in your project. Note that the command below will update all your NuGet packages, which is almost always what I want when upgrading the code samples I use for Orchard Core training. However, there are other commands depending on your particular needs.
$ dotnet outdated -u
Watch in awe as the dotnet-outdated tool updates all your Orchard Core packages. In this case, I am updating a simple Orchard Core website sample with just a couple of Orchard Core NuGet packages that was created by the Orchard Core code generation tools, but you can see how helpful this will be when you have numerous NuGet packages that need to be updated in more complex Orchard Core projects and solutions.
Although I am focusing on Orchard Core NuGet packages since they change frequently while in pre-release, the dotnet-outdated tool is not just for Orchard Core. Use it for updating your NuGet packages in all your projects. I find it quite handy and use it almost daily.