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?
To promote a cleaner development environment and to reduce repository size, NuGet Package Restore installs all of a project's dependencies listed in either the project file or packages. config . The . NET Core 2.0+ dotnet build and dotnet run commands do an automatic package restore.
With NuGet Package Restore you can install all your project's dependency without having to store them in source control. This allows for a cleaner development environment and a smaller repository size. You can restore your NuGet packages using the NuGet restore task, the NuGet CLI, or the . NET Core CLI.
Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.
The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don't need to explicitly use the dotnet restore command, since a NuGet restore is run implicitly if necessary when you run the following commands: dotnet new.
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.
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.
You'd better still use the NuGet Installer task during your build pipeline for now.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With