nuget-publishing

Diagnose and fix NuGet Trusted Publishing failures in GitHub Actions workflows.

2|Updated Aug 2, 2026
One-click install
npx skills add https://github.com/Arasz/ai-raccoon --skill nuget-publishing-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nuget-publishing
Source: https://github.com/Arasz/ai-raccoon/tree/main/.ai-badger/skills/learned/uncategorized/nuget-publishing
Command: npx skills add https://github.com/Arasz/ai-raccoon --skill nuget-publishing-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Publishing .NET packages to NuGet via GitHub Actions fails in non-obvious ways: OIDC token exchanges return 401 on environment mismatches, green publish runs push nothing due to swallowed 409 conflicts, multi-RID tool shells break installs on every platform but one, and stale NuGet http-caches make fresh versions uninstallable. This Skill provides verified diagnosis ladders and fixes for each failure mode. ## Core Features & Use Cases - Trusted Publishing setup: Configure NuGet OIDC policies, NuGet/login@v1, GitHub environment approval gates, and push-to-trunk triggers that survive branch protection rules. - Failure diagnosis: Step-by-step ladders for 401 environment mismatches, 409 reserved-namespace blocks, PackAsTool MSB3030 errors, multi-RID shell races, and stale http-cache install failures. - Release engineering conventions: Version-contract tests pinning PackageVersion, AssemblyVersion, and .mcp/server.json fields, plus PackageId bridge strategies when an id is reserved. - Use Case: Your publish workflow shows green but dotnet tool install says the version is not found — use this Skill to confirm the push landed, check the flat container and registration endpoints, and clear ~/.local/share/NuGet/http-cache. ## Quick Start Use the nuget-publishing skill to diagnose why my GitHub Actions publish workflow succeeded but the new package version cannot be installed.

Frequently Asked Questions about nuget-publishing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up NuGet Trusted Publishing with GitHub Actions?

Create a Trusted Publishing policy on nuget.org with your repository, workflow file name, and optional environment. In the workflow, use NuGet/login@v1 with the policy creator's profile name, grant id-token: write permission, and push with the output NUGET_API_KEY.

Why does NuGet OIDC token exchange fail with HTTP 401?

The GitHub Actions environment name in the OIDC token must exactly match the policy's Environment field on nuget.org. The 401 error message names both the expected and actual values, so read it as ground truth rather than trusting what the policy is believed to say.

Why does my publish run succeed but nothing was published to NuGet?

With --skip-duplicate, every 409 conflict is swallowed and the run still concludes success. Grep the push-step log for 'PUT ... 201 Created' versus 'Conflict ... already exists'; persistent 409s across all versions indicate a reserved namespace owned by someone else.

Why does dotnet tool install fail right after a successful NuGet push?

The user-level NuGet http-cache at ~/.local/share/NuGet/http-cache serves a stale registration index even though live endpoints show the new version. Delete that directory and retry the install; clearing v3-cache does nothing.

How do I fix a multi-RID dotnet tool that only installs on one platform?

Parallel pack jobs each emit a shell nupkg listing only their own RID, and --skip-duplicate keeps whichever arrives first. Patch every job's shell to list all RIDs before upload so all shells are byte-identical and the race becomes harmless.

Can I change a NuGet package id without renaming the installed dotnet tool command?

Yes. PackageId and ToolCommandName are independent, so renaming only PackageId keeps the installed command identical. Versions are per-id, and users migrate via uninstall and reinstall since dotnet tool update does not cross ids.