0Pricing
C# Academy · Lesson

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

  1. Library vs app .csproj, semantic versioning
  2. Packing & publishing to NuGet
  3. Multi-targeting
← Back to C# Academy