Publishing Packages
Learn how to create and publish professional NuGet packages to NugetHosting.
⏱️ 6 min read
Package Metadata
Good package metadata helps users find and understand your package. Add these properties to your .csproj:
<PropertyGroup>
<PackageId>YourCompany.PackageName</PackageId>
<Version>1.0.0</Version>
<Authors>Your Name</Authors>
<Company>Your Company</Company>
<Description>A clear description of what your package does</Description>
<PackageTags>tag1;tag2;tag3</PackageTags>
<PackageProjectUrl>https://github.com/yourcompany/package</PackageProjectUrl>
<RepositoryUrl>https://github.com/yourcompany/package</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>Versioning
Follow Semantic Versioning (SemVer):
MAJOR.MINOR.PATCH Example: 1.2.3- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Pre-release Versions
1.0.0-alpha
1.0.0-beta.1
1.0.0-rc.1Creating Packages
Using dotnet pack
dotnet pack -c ReleaseWith Symbol Package
dotnet pack -c Release --include-symbols --include-sourceOverride Version
dotnet pack -c Release -p:PackageVersion=2.0.0Publishing to NugetHosting
# Push all .nupkg files in Release folder
dotnet nuget push bin/Release/*.nupkg --source NugetHosting✅ Success: Your package will appear in the dashboard within a few seconds.
Updating Packages
To publish an update:
- Update the
Versionin your .csproj - Make your changes
- Run
dotnet pack -c Release - Push the new version
⚠️ Note: You cannot overwrite an existing version. Always increment the version number.