In my previous article, you learn how to update your projects to .NET 6, but I didn't take the time to write about updating your dependencies as well. ย ๐
Yes, even if your project continues to run, it might be a good idea to update your NuGet packages from time to time. Not only will you get the latest improvements, but you'll also get security patches if there are any. ๐ค
But, how do we do this? ๐ค
It turns out that your IDE can help you keep your dependencies up to date. ๐
Visual Studio
If you're using Microsoft's official IDE, Visual Studio, the procedure is quite simple. It only has five steps:
- In the top menu of the IDE, click
ToolsโNuGet Package ManagerโManage NuGet Packages for Solution....

NuGet - Solution window in Visual Studio.- In the upper right of the new window named
Nuget - Solution, click on to theUpdatestab. - Make sure that
Package Sourceis set toAll.

- Click on the
Updatebutton to update all libraries. - Launch your app and make sure it's still working properly.
Really simple, right? ๐
JetBrains Rider
If you are using JetBrains Rider as your IDE, the process is very similar:
- In the top menu of your IDE, click on
ToolsโNugetโShow Nuget Packages.

- A new window will appear that lists all the installed packages in your project and their respective version, next to their name. On the right, you'll see their latest version available.

- On the left of the NuGet window, click on the
Upgrade Packages in Solutionbutton (with the circled arrow).

- Select all the packages you want to update.
- Click on the
Upgradebutton to update all selected dependencies. - Finally, make sure your application still builds and runs as before.
There you go, your dependencies are now up to date! ๐ฅณ
Manual file editing
Again, if you look at the only modified file, the YOUR_PROJECT.csproj file, you might notice that we could just modify it as well. ๐ฎ

.csproj file after our changes.But it's easier to use the UI tool, isn't it? ๐
Conclusion
Don't forget to update your dependencies from time to time, otherwise, you could have security holes! A good rule of thumb is to do this every three months at least. ๐ง
Unless there is a lot of breaking changes, it should only be a matter of minutes now that you know how to do it. ๐
Update them all! ๐คฃ



