stride3d/stride · error · InvalidOperationException
Metadata loaded from nuspec cannot have more than one group…
Error message
Metadata loaded from nuspec cannot have more than one group of dependency
What it means
Thrown by PackageStore.PackageMetaFromNugetPackage when a parsed nuspec contains more than one dependency group. The converter maps nuspec metadata to a Stride PackageMeta which only supports a single dependency group, so anything else is rejected as unrepresentable.
Solutions
- Use a package variant that has a single dependency group (single-TFM nuspec).
- Pre-process the nuspec to merge dependency groups into one before conversion.
- Pick the dependency group matching your target framework and construct a nuspec with only that group.
- Rebuild the dependency package with a single-group nuspec.
Example fix
<!-- before: rejected nuspec --> <dependencies> <group targetFramework="net461">...</group> <group targetFramework="net6.0">...</group> </dependencies> <!-- after: single group only --> <dependencies> <group targetFramework="net6.0">...</group> </dependencies>
Defensive patterns
Strategy: validation
Validate before calling
if (nuspecMetadata.DependencySetsCount > 1)
{
// select/merge the group for your TFM before conversion
metadata = SelectSingleDependencyGroup(nuspecMetadata, targetFramework);
}
var meta = PackageStore.PackageMetaFromNugetPackage(...); Try / catch
try { meta = PackageStore.PackageMetaFromNugetPackage(...); }
catch (InvalidOperationException ex) when (ex.Message.Contains("more than one group of dependency"))
{
// pre-process the nuspec to a single dependency group and retry
} Prevention
- Prefer single-TFM packages when feeding this API.
- Pre-process multi-group nuspecs by merging or selecting the target-framework group.
- Validate nuspecs during package ingestion pipelines.
When it happens
Trigger: Building package metadata from a .nupkg/nuspec whose metadata contains 2+ <group> elements under <dependencies> (e.g. multi-targeting packages with per-TFM dependency groups).
Common situations: Consuming a third-party NuGet package built for multiple target frameworks; a hand-authored nuspec with several dependency groups; importing packages from feeds with multi-TFM layouts.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Could not find installation path for package
- The provided path is not a valid path name.
- Build manifest [ ] doesn't exist
- This tool requires an input file (package, project, or…
- Type [ ] must be assignable to Asset or be a Package
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/2dd62623330b7cc1.
Report an issue: GitHub.
Appendix: source
Thrown at sources/assets/Stride.Core.Assets/PackageStore.cs:178
IconUrl = metadata.IconUrl,
LicenseUrl = metadata.LicenseUrl,
ProjectUrl = metadata.ProjectUrl,
RequireLicenseAcceptance = metadata.RequireLicenseAcceptance,
Description = metadata.Description,
Summary = metadata.Summary,
Tags = metadata.Tags,
Listed = metadata.Listed,
Published = metadata.Published,
ReportAbuseUrl = metadata.ReportAbuseUrl,
DownloadCount = metadata.DownloadCount
};
meta.Authors.AddRange(metadata.Authors);
meta.Owners.AddRange(metadata.Owners);
if (metadata.DependencySetsCount > 1)
{
throw new InvalidOperationException("Metadata loaded from nuspec cannot have more than one group of dependency");
}
return meta;
}
public static void ToNugetManifest(PackageMeta meta, ManifestMetadata manifestMeta)
{
manifestMeta.Id = meta.Name;
manifestMeta.Version = meta.Version.ToString();
manifestMeta.Title = meta.Title.SafeTrim();
manifestMeta.Authors = meta.Authors;
manifestMeta.Owners = meta.Owners;
manifestMeta.Tags = string.IsNullOrEmpty(meta.Tags) ? null : meta.Tags.SafeTrim();
manifestMeta.LicenseUrl = ConvertUrlToStringSafe(meta.LicenseUrl);
manifestMeta.ProjectUrl = ConvertUrlToStringSafe(meta.ProjectUrl);
manifestMeta.IconUrl = ConvertUrlToStringSafe(meta.IconUrl);
manifestMeta.RequireLicenseAcceptance = meta.RequireLicenseAcceptance;
manifestMeta.DevelopmentDependency = false;View on GitHub (pinned to 96fad776d2)