NuGet package restore from build server – not downloading packages However… this didn’t work on our tfs build server. I removed my original packages folder from disc, and the build succeeded because nuget.exe (reference in the build) was able to download the packages. This will automate the download of packages during build, if packages aren’t on the machine yet.Īfter enabling this for a solution I’m working on, I had no problem running this locally. For this approach, you would migrate from the MSBuild-integrated package restore to the Automatic Package Restore approach, following the documented walkthrough.If you don’t want to check-in packages into your source control system, you can enable package restore. ![]() The latest version of NuGet.exe will infer consent to be ON even when not explicitly saved in the nfig file. nuget folder, which will download the latest version of NuGet.exe and replace the version in the. To do this, run nuget.exe update -self from your. Update the version of NuGet.exe in your.This forces your %AppData%\NuGet\nfig file to be saved with consent explicitly given, allowing NuGet 2.6 and earlier to see that you’ve given consent. Uncheck and then re-check the boxes for consent and click OK. To do this, open Visual Studio’s options and under Package Manager, choose General. Force save your NuGet settings with consent given.SolutionĪs explained on the Package Restore documentation, there are three ways to address this situation. To give consent, open the Visual Studio Options dialog, click on Package Manager node and check ‘Allow NuGet to download missing packages during build.’ You can also give consent by setting the environment variable ‘EnableNuGetPackageRestore’ to ‘true’. Then the old nuget.exe kicks in for the package restore and it does not find package restore consent to be given, yielding the following build error: When building this solution in Visual Studio, NuGet identifies that the MSBuild-integrated package restore is enabled and therefore automatic package restore is skipped. In those versions of nuget.exe, package restore consent was OFF by default (hard-coded to false when not present in nfig). nuget folder that has a nuget.exe in it versioned 2.6 or earlier. In this scenario, the solution contains a. The MSBuild-integrated package restore was enabled before NuGet 2.7 was released.An existing solution is opened where the MSBuild-integrated package restore has already been enabled.Using a freshly built machine or a machine where Visual Studio was freshly installed.The scenario isn’t extremely common, but we have already heard reports of it. In order to hit this problem, there’s a specific scenario you must be in. ![]() ![]() When we made the package restore changes in NuGet 2.7, we identified one scenario where this would happen but determined we couldn’t implement a fix and would rather have to document the cause and solution. After NuGet 2.7 was released with Automatic Package Restore and implicit consent, some users reported that they were still seeing build errors indicating that package restore consent had not been given.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |