{"record":{"id":"892308de6cae9d6d","repo":"stride3d/stride","slug":"assettype-should-inherit-from-asset","errorCode":null,"errorMessage":"assetType should inherit from Asset","messagePattern":"assetType should inherit from Asset","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Analysis/BuildDependencyInfo.cs","lineNumber":33,"sourceCode":"    public readonly Type CompilationContext;\n    /// <summary>\n    /// The type of asset targeted by this dependency.\n    /// </summary>\n    public readonly Type AssetType;\n    /// <summary>\n    /// The type of dependency, indicating whether the target asset must actually be compiled, and whether it should be compiled before the referecing asset or can be at the same time.\n    /// </summary>\n    public readonly BuildDependencyType DependencyType;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"BuildDependencyInfo\"/> structure.\n    /// </summary>\n    /// <param name=\"assetType\">The type of asset targeted by this dependency info.</param>\n    /// <param name=\"compilationContext\">The compilation context in which to compile the target asset.</param>\n    /// <param name=\"dependencyType\">The type of dependency.</param>\n    public BuildDependencyInfo(Type assetType, Type compilationContext, BuildDependencyType dependencyType)\n    {\n        if (!typeof(Asset).IsAssignableFrom(assetType)) throw new ArgumentException($@\"{nameof(assetType)} should inherit from Asset\", nameof(assetType));\n        if (!typeof(ICompilationContext).IsAssignableFrom(compilationContext)) throw new ArgumentException($@\"{nameof(compilationContext)} should inherit from ICompilationContext\", nameof(compilationContext));\n        AssetType = assetType;\n        CompilationContext = compilationContext;\n        DependencyType = dependencyType;\n    }\n\n    /// <inheritdoc/>\n    public readonly bool Equals(BuildDependencyInfo other)\n    {\n        return ReferenceEquals(CompilationContext, other.CompilationContext) && ReferenceEquals(AssetType, other.AssetType) && DependencyType == other.DependencyType;\n    }\n\n    /// <inheritdoc/>\n    public override readonly bool Equals(object? obj)\n    {\n        if (ReferenceEquals(null, obj))\n            return false;\n        return obj is BuildDependencyInfo info && Equals(info);","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Analysis/BuildDependencyInfo.cs#L15-L51","documentation":"Constructor argument validation for the BuildDependencyInfo struct: the assetType parameter does not inherit from Asset, so it cannot legally describe a build dependency target. The faulting input is the assetType argument.","triggerScenarios":"Thrown at sources/assets/Stride.Core.Assets/Analysis/BuildDependencyInfo.cs:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an Asset-derived type as assetType","If depending on a non-asset, use the appropriate dependency mechanism instead of BuildDependencyInfo"],"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"}