Repository navigation
(#66) Add supportsInstances Nuspec Metadata Field - #67
Merged
Merged
Conversation
Chocolatey package instances let a package declare that it may be installed more than once, and that declaration lives in the nuspec. Without a field for it, packing through this fork silently dropped the value, so every instance gate downstream read it as not declared. Read supportsInstances from the nuspec, carry it through ManifestMetadata and PackageBuilder, write it back out when set, and add it to the nuspec schema. It is deliberately kept off the IPackageMetadata interface: adding a member there breaks every external implementer. Package Instances have to ship in a 2.x release of Chocolatey CLI, which cannot take breaking changes in the dependencies it uses, so the copy paths read the value from the concrete types instead. A comment on the interface records that it should be added at the next breaking release of Chocolatey CLI (3.x).
gep13
force-pushed
the
package-instances
branch
from
November 4, 2026 21:26
451da8b to
f5ea6de
Compare
2 of 12 tasks
vexx32
reviewed
Nov 5, 2026
vexx32
left a comment
Member
There was a problem hiding this comment.
Overall looks good, but I do have one question about the direction taken here.
vexx32
approved these changes
Nov 5, 2026
vexx32
left a comment
Member
There was a problem hiding this comment.
Looks good to me, great work ^^
This was referenced Nov 5, 2026
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.
Description Of Changes
Adds the
supportsInstancesnuspec metadata field to the NuGet.Packaging library in this fork.supportsInstancesfrom the nuspec (ChocolateyNuspecReader.GetSupportsInstancesandManifestReader).ManifestMetadataandPackageBuilder, including the copy paths, and writes it back out when it is set (PackageMetadataXmlExtensions).nuspec.xsd).PublicAPI.Unshipped.txtfornet472,netstandard2.0andnetcoreapp5.0.IPackageMetadatainterface. The copy paths read it from the concrete types, and a comment on the interface says to add it at the next breaking release of Chocolatey CLI (3.x).Motivation and Context
Chocolatey package instances let a package declare that it may be installed more than once, and that declaration lives in the nuspec. Without a field for it, packing through this fork silently dropped the value, so every instance gate downstream read it as not declared.
Package Instances have to ship in a 2.x release of Chocolatey CLI, which cannot take breaking changes in the dependencies it uses. Adding a member to
IPackageMetadatawould break every external implementer, so the value travels on the concrete types only, and any other implementer of the interface yieldsfalse.Testing
This will need to be tested in conjunction with PR's into CLI and CLE.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #66