fix: produce valid NuGet packages from package nuget create - #632
Open
NickJosevski wants to merge 2 commits into
Open
fix: produce valid NuGet packages from package nuget create#632NickJosevski wants to merge 2 commits into
NickJosevski wants to merge 2 commits into
Conversation
The command wrote the nuspec and the matched files into a zip and named it .nupkg. A .nupkg is an Open Packaging Conventions container, so the result was missing [Content_Types].xml, _rels/.rels and the core properties part. Opened with a real OPC reader the package resolves to zero parts and no manifest relationship, which is why feeds such as Cloudsmith and Artifactory reject or fail to list it. Generate the three OPC parts alongside the nuspec. Content types are derived from the extensions actually present, with an Override for any part that has no extension, and the generated part and relationship names are derived from the package id and version so repacking the same inputs is reproducible. Directory records are also omitted from .nupkg archives, since OPC part names may not end in "/". `package zip create` is untouched and still includes them. Fixes #477 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches how the repo names a variant that takes extra behaviour: DeleteWithConfirmation, SelectMapWithNew, MapCollectionWithLookups. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NickJosevski
marked this pull request as ready for review
August 5, 2026 04:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #477
Problem
package nuget createwrote the nuspec and the matched files into a zip and named it.nupkg. A.nupkgis an Open Packaging Conventions container, not a plain zip, so the result was missing every OPC part:Opened with .NET's OPC reader — which is what strict feeds use — that package resolves to zero parts and has no manifest relationship at all:
Change
See
BuildPackageWithContentsandbuildArchiveVerification
Structure now matches
dotnet packexactly.Validated with a real .NET OPC reader (
System.IO.Packaging+NuGet.Packaging), before and after:🤖 Generated with Claude Code