nugetnuget-packagenuget-package-restoremygetazure-artifacts

Dealing with frequently updated NuGet packages


I would like to understand what is the common workflow of working with NuGet packages that are frequently updated?

So take an example - we have these projects:

We develop our WCF Service daily, and therefore it's contracts and client NuGet packages are updated very often. The question - should we update all projects with latest NuGet package every time we make a change to our Contracts and Clients (even if it's not a breaking change)? Keep in mind - we might have more than 20 projects referencing these NuGet packages and we want to ensure that at no point our applications work differently when calling the same method? Surely there is a better way than manually updating these 20 projects every day to reference the latest NuGet package!

Is there a way to automatically update nuget packages to latest stable build?


Solution

  • It is based on the detail requirement, for example, if you need to make sure these packages are up to date, then the packages need to be updated manually or automatically, otherwise, you can just update the packages once there are major updates of the packages.

    To update packages automatically, as Jeroen said that you can call update-package command before build by adding a custom Target (update project file), you also can define update-package command in Pre-build event command line (right click the project > Property > Build Events).