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套件不應該用來產生 SDK 樣式專案的套件。

解決方案

請改用 dotnet packmsbuild -t:pack。 建議您不要使用舊版 csproj 套件體驗,因為它會產生不完整的套件。