There are two types of automatic packet recovery. The one that starts when creating the solution in Visual Studio, as well as based on MSBuild and requires changing your project to start restoring NuGet.exe as part of the assembly. MSBuild-based recovery is enabled by selecting "Enable NuGet Package Recovery", but this has been canceled by the NuGet team.
For the build server, you will need to either:
- Run
NuGet.exe restore for all solutions before starting the build. - Restore NuGet packages with MSBuild as you build your core solution.
To restore NuGet packages using MSBuild, you can use legacy MSBuild-based NuGet package recovery, or it might be better to create the Before.YourSolution.sln.targets file as described in the Ultimate Cross Platform NuGet Restore . The Custom before .... hosts file will need to restore packages for the submodule.
If you are using MSBuild-based recovery, one of the advantages is that there is no preliminary build phase that the user must complete before building the solution, since creating the solution performs the restoration. One of the problems with recovering a package based on MSBuild, at least with the one that is enabled when you select Enable NuGet Package Restore in Visual Studio, is that it can cause problems with NuGet packages that use their own MSBuild.targets files.
source share