stride3d/stride · error · InvalidOperationException

No AssetPropertyGraph type matching the given asset type…

Error message

No AssetPropertyGraph type matching the given asset type has been found

What it means

AssetQuantumRegistry.ConstructPropertyGraph walked the asset type's inheritance chain (including generic type definitions) and found no registered AssetPropertyGraph type. The asset class and none of its bases carry an AssetPropertyGraphAttribute, so no property graph can be constructed for it.

Solutions

  1. Add an AssetPropertyGraphAttribute to the asset type (or a base type) pointing at a suitable AssetPropertyGraph subclass
  2. Verify the assembly containing the attribute-decorated graph was registered with AssetQuantumRegistry.RegisterAssembly
  3. For generic assets, ensure the generic type definition is registered
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs:101 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/d02da65b8b8cd31b. Report an issue: GitHub.

Appendix: source

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

                    NodeGraphDefinitions.Add(attribute.AssetType, definition);
                }
            }
        }
    }

    public static AssetPropertyGraph ConstructPropertyGraph(AssetPropertyGraphContainer container, AssetItem assetItem, ILogger? logger)
    {
        var assetType = assetItem.Asset.GetType();
        while (assetType is not null)
        {
            var typeToTest = assetType.IsGenericType ? assetType.GetGenericTypeDefinition() : assetType;
            if (NodeGraphTypes.TryGetValue(typeToTest, out var propertyGraphType))
            {
                return (AssetPropertyGraph)Activator.CreateInstance(propertyGraphType, container, assetItem, logger)!;
            }
            assetType = assetType.BaseType;
        }
        throw new InvalidOperationException("No AssetPropertyGraph type matching the given asset type has been found");
    }

    public static AssetPropertyGraphDefinition GetDefinition(Type assetType)
    {
        if (!typeof(Asset).IsAssignableFrom(assetType))
            throw new ArgumentException($"The type {assetType.Name} is not an asset type");

        var currentType = assetType;
        while (currentType is not null && currentType != typeof(Asset))
        {
            // ReSharper disable once AssignNullToNotNullAttribute - cannot happen
            if (NodeGraphDefinitions.TryGetValue(currentType, out var definition))
            {
                // Register the instance for this specific type so we don't have to do this again next time.
                if (currentType != assetType)
                {
                    NodeGraphDefinitions.Add(assetType, definition);
                }

View on GitHub (pinned to 96fad776d2)