NuGet Error NU5023

The assets file produced by restore does not exist. Try restoring the project again. The expected location of the assets file is F:\project\obj\project.assets.json.

Issue

The project passed to the msbuild -t:pack does not contain an assets file in the obj directory.

Solution

Please run msbuild -t:restore operation on the project being packaged before running the pack operation.