🌐 Documentation is currently available in English only. We're working on translations.

Home / Docs / NuGet Guide / Publishing Packages

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.1

Creating Packages

Using dotnet pack

dotnet pack -c Release

With Symbol Package

dotnet pack -c Release --include-symbols --include-source

Override Version

dotnet pack -c Release -p:PackageVersion=2.0.0

Method 1: dotnet CLI

The most common way to publish packages is using the dotnet CLI:

# Push all .nupkg files in Release folder
dotnet nuget push bin/Release/*.nupkg --source NugetHosting

Or specifying the source URL and API key directly:

# Push specifying source and API key
dotnet nuget push bin/Release/YourPackage.1.0.0.nupkg \
  --source https://nuget.nugethosting.com/v3/package \
  --api-key YOUR_API_TOKEN

✅ Success: Your package will appear in the dashboard within a few seconds.

Bulk Migration

Migrating from another NuGet source? You can push all your .nupkg files at once with a single command. The --skip-duplicate flag ensures packages that already exist on the server are ignored instead of causing errors.

# Push all .nupkg files in the current directory
dotnet nuget push "*.nupkg" \
  --source NugetHosting \
  --api-key nh_live_... \
  --skip-duplicate

Or if your packages are in a specific folder:

# Push from a specific folder (recursive)
dotnet nuget push "packages/**/*.nupkg" \
  --source NugetHosting \
  --api-key nh_live_... \
  --skip-duplicate

💡 Tip: Make sure you've configured the NugetHosting source first using dotnet nuget add source. See the dotnet CLI setup guide for details.

✅ Safe to re-run: Thanks to --skip-duplicate, you can run this command multiple times without errors. Already-uploaded packages will be skipped automatically.

Method 2: NuGet Package Explorer

You can also publish packages using NuGet Package Explorer, a GUI tool for inspecting and publishing .nupkg files.

  1. Open your .nupkg file in NuGet Package Explorer
  2. Go to File → Publish (or press Ctrl+P)
  3. Configure the publish dialog:
FieldValue
Publish Urlhttps://nuget.nugethosting.com/v3/package
Publish key or PATYour API token from the Tokens page
Append 'api/v2/package'✗ Unchecked

⚠️ Important: Make sure to uncheck "Append 'api/v2/package' to publish url". NugetHosting uses the V3 API directly.

Method 3: Dashboard Upload

You can upload packages directly from the NugetHosting web dashboard:

  1. Go to the Packages page in your dashboard
  2. Click "Upload Package"
  3. Drag and drop your .nupkg file or click to browse
  4. The package metadata will be extracted automatically from the .nuspec inside the package

💡 Tip: Dashboard upload is ideal for quick one-off uploads. For CI/CD pipelines and automated workflows, use the dotnet CLI method.

Updating Packages

To publish an update:

  1. Update the Version in your .csproj
  2. Make your changes
  3. Run dotnet pack -c Release
  4. Push the new version

⚠️ Note: You cannot overwrite an existing version. Always increment the version number.

Deleting Packages

You can delete a specific package version using the CLI, or from the dashboard.

Using dotnet CLI

# Delete a specific version (using configured source)
dotnet nuget delete YourPackage 1.0.0 --source NugetHosting --non-interactive

Or specifying the source URL and API key directly:

# Delete specifying source and API key
dotnet nuget delete YourPackage 1.0.0 \
  --source https://nuget.nugethosting.com/v3/package \
  --api-key YOUR_API_TOKEN \
  --non-interactive

Using the Dashboard

  1. Go to the Packages page
  2. Click on the package you want to manage
  3. Select the version to delete or use the delete option

⚠️ Warning: Deleting a package version is permanent. Download statistics for that version are preserved, but the package file will be removed from storage and cannot be recovered.

💡 Tip: If you want to hide a package version from search results without deleting it, consider unlisting it from the dashboard instead.

Was this page helpful?