Evolving NuGet CLI options:
- 2012: NuGet.exe + msbuild
- 2017: msbuild centric, with nuget.exe to push packages
- 2017: dotnet.exe centric
Evolving NuGet CLI options:
@md classlib-packages | |
dotnet new classlib -o classlib1 | |
@echo build a netstandard class library with msbuild - restore, pack, and push with nuget.exe | |
@echo -- technique since ~2013 | |
cd classlib1 | |
nuget restore classlib1.csproj | |
msbuild /t:build /p:Configuration=Release /verbosity:minimal | |
nuget pack -prop Configuration=Release -OutputDirectory bin\release\ | |
nuget push bin\release\*.nupkg -source c:\temp\classlib-packages\ | |
cd .. | |
dotnet new classlib -o classlib2 | |
@echo restore, build and pack a netstandard class library with msbuild - push with nuget.exe | |
@echo - when using PackageReferences only, and no Packages.Config, msbuild (15.6 and later) can do the restore and packing | |
cd classlib2 | |
msbuild /restore /t:build;pack /p:Configuration=Release /verbosity:minimal | |
nuget push bin\release\*.nupkg -source c:\temp\classlib-packages\ | |
cd .. | |
dotnet new classlib -o classlib3 | |
@echo restore, build and pack a netstandard class library with dotnet.exe | |
@echo - when using PackageReferences only with project types that dotnet sdk supports, dotnet.exe can do it all | |
cd classlib3 | |
dotnet pack /p:Configuration=Release | |
dotnet nuget push bin\release\*.nupkg -s c:\temp\classlib-packages\ | |
cd .. |