How to do a NuGet package restore after your compile fails.
Recently, I was creating a WebAPI in .NET 5 and when I tried to compile, I got this error message:

Run a NuGet package restore to generate this file.

The simplest way to do this is:

  1. Right click on the solution.
  2. Select Restore NuGet Packages from the popup menu.
  3. Recompile the application.

The app will compile with no problems after the NuGet packages are restored.

Translate »
%d bloggers like this: