Enable Nuget Package Restore
To enable Nuget Package Restore, first check if package restore is enabled from the visual studio options.
Allow Nuget to download missing packages
Open visual studio and follow the steps given below:
Tools / Options / NuGet Package Manager / Allow NuGet to download missing packages
Lastly check the checkbox for "Allow NuGet to download missing packages" as shown in the following image.
If it is already enabled open Nuget Package Manager console:
Tools / NuGet Package Manager / Package Manager Console
Run the command
Install-Package NuGetEnablePackageRestore
You may get the result
========================
NuGet Enable Package Restore Fix
========================
To fix package restore:
1. Please enable package restore in Visual Studio FIRST.
2. Run the command: Install-NuGetEnablePackageRestoreFix
3. Restart Visual Studio.
This should fix that pesky broken build you are experiencing.
Then, just run the command
Install-NuGetEnablePackageRestoreFix
and restart Visual Studio.