Packing & publishing to NuGet
Pack a library into a .nupkg and publish it. Fill minimal metadata, run dotnet pack, push with an API key, and follow safe publishing practices.
Plan
Aim: Build and publish a NuGet package.
- Fill basic metadata in the project
- Run dotnet pack to get a .nupkg
- Use an API key to dotnet nuget push
- Follow safe publishing checks
Metadata to set
- PackageId: unique ID (e.g., Company.Widget)
- Version: MAJOR.MINOR.PATCH
- Authors, Description
- PackageLicenseExpression (e.g., MIT) or license file
- RepositoryUrl (optional but useful)
All lessons in this course
- Library vs app .csproj, semantic versioning
- Packing & publishing to NuGet
- Multi-targeting