Be Sure to Use the Latest Version of NuGet Restore Task in VSTS Builds
If you use the Nuget restore task in your VSTS builds, make sure you're using the newest version so you don't miss out on its interesting features.
Join the DZone community and get the full member experience.Join For Free
if you have old builds in vsts that use the nuget restore task, it is time to check if you are using the new version, because if you still use the 0.x version, you are missing some interesting features.
with vsts builds, it is always a good habit to periodically check if some of the tasks have a new version. here is as an example of how version 0 is configured:
figure 1: nuget restore task in version 0.
in figure 1, you see how you configure a standard nuget restore task. if you are using version 0 (2), it is time to upgrade, especially because the old version of the task is not so flexible about the version to use (3).
figure 2: thanks to the nugettoolinstaller task, you can ensure that a specific version of nuget is present in the system and used by all subsequent tasks.
before changing versions, you need to know that the newer version of this task goes hand-in-hand with another new task, the nuget tool installer task , that is designed to download and install a specific version of nuget that will be used by all subsequent tasks in the phase.
figure 3: nuget task version 2 in action.
the nuget tool installer also ensures that all nuget tasks will use the very same version.
figure 4: a little flag icon warn you that you are using an old version of this task.
after the nuget tool installer, you can simply configure the nuget task in version 2 (see figure 3).
as you can see, you do not need to specify any version; the version used will be the one installed by the nuget installer task, so you are always sure that the exact version of nuget is installed and available for the build to be used.
as usual, if you have a build that sits there for a long time, take your time to check if some of the tasks are available in a newer and more powerful version. if you wonder how you can immediately check if some of the tasks have a newer version, simply check for a little flag near the description of the task, as shown in figure 4.
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.