{"record":{"id":"f4cf0a5845137e48","repo":"stride3d/stride","slug":"the-type-assettype-name-is-not-an-asset-type","errorCode":null,"errorMessage":"The type {assetType.Name} is not an asset type","messagePattern":"The type (.+?) is not an asset type","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs","lineNumber":107,"sourceCode":"    public static AssetPropertyGraph ConstructPropertyGraph(AssetPropertyGraphContainer container, AssetItem assetItem, ILogger? logger)\n    {\n        var assetType = assetItem.Asset.GetType();\n        while (assetType is not null)\n        {\n            var typeToTest = assetType.IsGenericType ? assetType.GetGenericTypeDefinition() : assetType;\n            if (NodeGraphTypes.TryGetValue(typeToTest, out var propertyGraphType))\n            {\n                return (AssetPropertyGraph)Activator.CreateInstance(propertyGraphType, container, assetItem, logger)!;\n            }\n            assetType = assetType.BaseType;\n        }\n        throw new InvalidOperationException(\"No AssetPropertyGraph type matching the given asset type has been found\");\n    }\n\n    public static AssetPropertyGraphDefinition GetDefinition(Type assetType)\n    {\n        if (!typeof(Asset).IsAssignableFrom(assetType))\n            throw new ArgumentException($\"The type {assetType.Name} is not an asset type\");\n\n        var currentType = assetType;\n        while (currentType is not null && currentType != typeof(Asset))\n        {\n            // ReSharper disable once AssignNullToNotNullAttribute - cannot happen\n            if (NodeGraphDefinitions.TryGetValue(currentType, out var definition))\n            {\n                // Register the instance for this specific type so we don't have to do this again next time.\n                if (currentType != assetType)\n                {\n                    NodeGraphDefinitions.Add(assetType, definition);\n                }\n                return definition;\n            }\n\n            if (currentType.IsGenericType)\n            {\n                // If we reach a generic type, we must check if we have a matching generic definition and if so, create a proper instance of this generic type.","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs#L89-L125","documentation":"Guard in GetDefinition: the registry was asked for a property-graph definition for a type that is not an Asset (IsAssignableFrom check failed). The faulting input is the assetType argument, which does not inherit from Asset.","triggerScenarios":"Thrown at sources/assets/Stride.Core.Assets.Quantum/AssetQuantumRegistry.cs:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only request definitions for types deriving from Asset","Register or look up the correct Asset-derived type instead of a raw data type"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}