{"record":{"id":"f6ac28b301f19d29","repo":"stride3d/stride","slug":"the-given-type-must-be-assignable-to-the-nameof-asset-type","errorCode":null,"errorMessage":"The given type must be assignable to the {nameof(Asset)} type.","messagePattern":"The given type must be assignable to the (.+?) type\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets.Quantum/AssetPropertyGraphAttribute.cs","lineNumber":17,"sourceCode":"// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)\n// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.\n\nusing Stride.Core.Annotations;\nusing Stride.Core.Reflection;\n\nnamespace Stride.Core.Assets.Quantum;\n\n[AttributeUsage(AttributeTargets.Class, Inherited = false)]\n[BaseTypeRequired(typeof(AssetPropertyGraph))]\n[AssemblyScan]\npublic class AssetPropertyGraphAttribute : Attribute\n{\n    public AssetPropertyGraphAttribute(Type assetType)\n    {\n        ArgumentNullException.ThrowIfNull(assetType);\n        if (!typeof(Asset).IsAssignableFrom(assetType)) throw new ArgumentException($\"The given type must be assignable to the {nameof(Asset)} type.\");\n        AssetType = assetType;\n    }\n\n    public Type AssetType { get; }\n}\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets.Quantum/AssetPropertyGraphAttribute.cs#L1-L23","documentation":"Constructor guard on AssetPropertyGraphAttribute: the assetType argument is not a subclass of Stride.Core.Assets.Asset, so it cannot be registered as the target type of a property node graph. The faulting input is the assetType parameter passed to the attribute.","triggerScenarios":"Thrown at sources/assets/Stride.Core.Assets.Quantum/AssetPropertyGraphAttribute.cs:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a type that derives from Asset (or Asset itself) to the attribute constructor","If the target is a plain data class, do not mark it with AssetPropertyGraphAttribute"],"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"}