Couldn't find the required information in the lock file.

This is my current error:

Couldn’t find the required information in the lock file. Make sure you have .NETCore,Version=v4.5.1 mentioned in your targets.

Any advice?

Not sure if this is the same issue, but I started getting this after building a Windows 10 deployment. It was fixed by removing the binaries (although I don’t claim to know why).