stride3d/stride · error · ArgumentException

The type already has an associated property node graph type.

Error message

The type {attribute.AssetType.Name} already has an associated property node graph type.

What it means

Registration-time conflict in AssetQuantumRegistry.RegisterAssembly: two AssetPropertyGraphAttribute-decorated graph types claim the same AssetType, and TryAdd on the NodeGraphTypes map rejected the second one. Indicates duplicate graph registrations for one asset type, usually from two attributes pointing at the same asset class.

Solutions

  1. Remove the duplicate AssetPropertyGraphAttribute so only one graph type is registered per asset type
  2. If a more specific graph is needed, derive the new graph from the existing one and move the attribute to it
  3. Check for copy-pasted attributes across assemblies targeting the same Asset subclass
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/e6bd96006d5725d5. Report an issue: GitHub.

Appendix: source

Thrown at sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs:55

        // already buckets the [AssemblyScan] graph attributes, so this skips loading unrelated types (some
        // assemblies, e.g. Stride.Assets referencing MSBuild, can't fully load all their types in every host).
        var scanTypes = AssemblyRegistry.GetScanTypes(assembly);
        if (scanTypes is null)
            return;

        if (scanTypes.Types.TryGetValue(typeof(AssetPropertyGraphAttribute), out var graphTypes))
        {
            foreach (var type in graphTypes)
            {
                var attribute = type.GetCustomAttribute<AssetPropertyGraphAttribute>();
                if (attribute is null)
                    continue;

                if (type.GetConstructor(AssetPropertyNodeGraphConstructorSignature) is null)
                    throw new InvalidOperationException($"The type {type.Name} does not have a public constructor matching the expected signature: ({string.Join(", ", (IEnumerable<Type>)AssetPropertyNodeGraphConstructorSignature)})");

                if (!NodeGraphTypes.TryAdd(attribute.AssetType, type))
                    throw new ArgumentException($"The type {attribute.AssetType.Name} already has an associated property node graph type.");
            }
        }

        if (scanTypes.Types.TryGetValue(typeof(AssetPropertyGraphDefinitionAttribute), out var definitionTypes))
        {
            foreach (var type in definitionTypes)
            {
                var attribute = type.GetCustomAttribute<AssetPropertyGraphDefinitionAttribute>();
                if (attribute is null)
                    continue;

                if (type.GetConstructor(Type.EmptyTypes) is null)
                    throw new InvalidOperationException($"The type {type.Name} does not have a public parameterless constructor.)");

                if (NodeGraphDefinitions.ContainsKey(attribute.AssetType))
                    throw new ArgumentException($"The type {attribute.AssetType.Name} already has an associated property node graph type.");

                if (attribute.AssetType.IsGenericTypeDefinition && type.IsGenericType)

View on GitHub (pinned to 96fad776d2)