This project references NuGet package(s) that are missing on this computer

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  

When getting this error, Visual Studio indicates that a NuGet package is missing from your project references.  If you take a look at the project->references node, you will probably see that there are some missing libraries that have been added to the project via a NuGet package installation, and your system does not have the package.  These files may even be the core .Net libraries like System, System.Xml etc.

To address this problem, we can just follow these steps:
  • Select Solution Explorer
  • Right click on the Solution Name
  • Click Enable NuGet Package Restore

This tells Visual Studio that whenever it finds a missing package, it needs to download it. After this has been enabled, we need to reload each project that has the missing references. This can be done by closing and opening the solution which will reload all the projects or just unloading and reloading each specific project (right click on the project name to see the unload project option).

Another area to make sure that the Package restore feature is enabled is to look for the .nuget folder in the solution’s directory. There should be a Nuget.targets file which manages the restore.

I hope this helps.


Post a Comment

What do you think?