NuGet 错误 NU5049

The `pack` command for SDK-style projects is not supported, use `dotnet pack` or `msbuild -t:pack` to pack this project instead. You can override this behavior by setting the 'NUGET_ENABLE_LEGACY_CSPROJ_PACK' environment variable to 'true'.

问题

NuGet.exe pack 不应用于为 SDK 式项目生成包。

解决方案

请改用 dotnet packmsbuild -t:pack。 建议在生成非完整包时不使用旧的 csproj 打包体验。