
Khalid Abuhakmeh · 5 min readC# & .NET
Build and Test a NuGet Package Locally
Learn how to create a .nupkg, host it in a local folder feed, and consume it from another project, enabling safe iteration before publishing to nuget.org. The guide covers metadata setup, version handling, cache clearing, and embedding symbols for debugging.
- Set PackageId, Version, and metadata in the .csproj and run dotnet pack to produce a .nupkg
- Register a folder as a local NuGet source via nuget.config or dotnet nuget add source
- Increment the package version or clear the global cache to see code changes during local testing