NuGet 错误 NU5025

The assets file found does not contain a valid package spec. Try restoring the project again. The location of the assets file is F:\project\obj\project.assets.json.

问题

传递给 msbuild -t:pack 的项目在 obj 目录中不含有效的资产文件。

解决方案

请在运行 pack 操作之前对正在打包的项目运行 msbuild -t:restore -p:restoreforce=true 操作。