What's the difference using NuGet Installer task and "Restore Nuget Packages" in Visual Studio Build step?
Asked Answered
R

3

6

For TFS build (I use TFS 2017) should I use NuGet Installer task or use the Visual Studio Build step in the build configuration to restore all NuGet packages. Which is the preferred way to use it?

Rubenrubens answered 18/7, 2017 at 14:4 Comment(0)
C
6

You'd better still use the NuGet Installer task during your build pipeline for now.

enter image description here

This option is deprecated. To restore NuGet packages, add a NuGet Installer step before the build.

You could also find related prompting message in Visual Studio Build task tutorial.

Restore NuGet Packages

(Important) This option is deprecated. Make sure to clear this checkbox and instead use the NuGet Installer build step.

Carlyle answered 19/7, 2017 at 2:27 Comment(0)
N
6

At first, I was confused because I thought the NuGet Restore task before the build was where the error was coming from. The answer from Patrick-MSFT helped me find the correct answer but I am adding more information and context. Build Definition edit in TFS 2017

As you can see, the checkbox for the NuGet Restore is under the Build task, just like @Patrick-MSFT showed. What confused me, however, was before my Build task I had a NuGet Installer task with name NuGet restore. The unchecking the checkbox should remove the error.

Nacreous answered 30/9, 2017 at 0:6 Comment(0)
T
0

The nuget team changed the way that nuget restores packages. You used to have to enable restore against your sln, which modded your csproj's; this is what the deprecated "restore nuget packages" does. Now, you use the nuget task/step before building the sln.

See: http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

Tiphane answered 10/1, 2018 at 23:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.