Errore 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'.

Problema

NuGet.exe pacchetto non deve essere usato per generare pacchetti per i progetti in stile SDK.

Soluzione

In sostituzione utilizzare dotnet pack o msbuild -t:pack. È consigliabile non usare l'esperienza csproj pack legacy perché genera pacchetti incompleti.