Troubleshooting package restore errors in Visual Studio

Package Restore tries to install all package dependencies to the correct state matching the package references in your project file (.csproj) or your packages.config file. (In Visual Studio, the references appear in Solution Explorer under the Dependencies \ NuGet or the References node.) To follow the required steps to restore packages, see Restore packages. If the package references in your project file (.csproj) or your packages.config file are incorrect (they do not match your desired state following Package Restore), then you need to either install or update packages instead of using Package Restore.

If the instructions here do not work for you, please file an issue on GitHub so that we can examine your scenario more carefully. Do not use the "Is this page helpful?" control that may appear on this page because it doesn't give us the ability to contact you for more information.

Quick solution for Visual Studio users

If you're using Visual Studio, first enable package restore as follows. Otherwise continue to the sections that follow.

Select the Tools > NuGet Package Manager > Package Manager Settings menu command.

Set both options under Package Restore.

Select OK.

Build your project again.

These settings can also be changed in your NuGet.config file; see the consent section. If your project is an older project that uses the MSBuild-integrated package restore, you may need to migrate to automatic package restore.

Post a Comment

0 Comments