Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget 2.7 ignores repositorypath when restoring packages

Since I upgraded to nuget 2.7, it is not respecting the repository path that was set in the nuget.config in my solution directory.

It only ignores it when restoring the packages, however if I add a new package it respects the repository path.

How do you make nuget restore to look for the packages in the directory specified in the repository path in my nuget.config?

like image 473
ryudice Avatar asked Oct 31 '13 16:10

ryudice


People also ask

How do I force a NuGet package to restore?

Restore packages manually or automatically After you enable package restore in Options, you can right-click the solution in Solution Explorer and select Restore NuGet Packages to restore packages anytime.

How do I fix a NuGet package error?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.

Does Msbuild restore NuGet packages?

msbuild -t:Restore will restore nuget packages for projects with PackageReference nuget management format. And your situation looks like packages. config nuget management format which you have used it.


1 Answers

  1. You are probably experiencing this bug, which has been fixed in NuGet 2.7.2.

  2. Otherwise, could it be that you are using NuGet v2.7 with a solution that was configured to use the MSBuild-integrated package restore approach of NuGet <= v2.6?

    Please follow the steps in Migrating MSBuild-Integrated solutions to use Automatic Package Restore. In short, what you should do is remove the .nuget folder (which contains nuget.exe, nuget.config and nuget.targets) from your solution, and also remove all references to nuget.targets from your projects.

like image 78
Yodan Tauber Avatar answered Sep 18 '22 16:09

Yodan Tauber