The solution to this is specified in link in the error message itself.
This is happening due to an Improvement as specified in that page:
The Improvement
We’ve updated Microsoft.Bcl.Build to use a different approach. The new version will use a conditional import similar to what NuGet’s automatic import feature does. This will always allow the project to load in Visual Studio.
However, Microsoft.Bcl.Build also adds a target to your project that will run after the build is finished. This target checks whether the current build restored packages and if so fail the build with an actionable error message:
Building a second time will fix this error. Please note that this error will only appear if packages were missing so it’s not like you always have to build twice.
Then it specifies as below for the case of build server / continuous integration (CI):
This solution doesn’t address build server / continuous integration (CI) scenarios. In order to successfully use package restore on the build server, you have two options:
- Check-in the .targets file.
- Explicitly run NuGet package restore prior to building your project/solution.
So, I suppose for your issue resolution the above two steps should be followed.