{"record":{"id":"023f5d1e4f5cb730","repo":"Unity-Technologies/UnityCsReference","slug":"given-rpassettype-must-derive-from-renderpipelinea","errorCode":null,"errorMessage":"Given rpAssetType must derive from RenderPipelineAsset","messagePattern":"Given rpAssetType must derive from RenderPipelineAsset","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Inspector/ScriptableRenderPipelineExtensionAttribute.deprecated.cs","lineNumber":19,"sourceCode":"// Unity C# reference source\n// Copyright (c) Unity Technologies. For terms of use, see\n// https://unity3d.com/legal/licenses/Unity_Reference_Only_License\n\nusing System;\nusing UnityEngine.Rendering;\n\nnamespace UnityEditor.Rendering;\n\n[Obsolete($\"{nameof(ScriptableRenderPipelineExtensionAttribute)} is deprecated. Use {nameof(SupportedOnRenderPipelineAttribute)} instead. #from(23.1) (UnityUpgradable) -> UnityEngine.Rendering.SupportedOnRenderPipelineAttribute\", false)]\n[AttributeUsage(AttributeTargets.Class)]\npublic class ScriptableRenderPipelineExtensionAttribute : Attribute\n{\n    internal Type renderPipelineType;\n\n    public ScriptableRenderPipelineExtensionAttribute(Type rpAssetType)\n    {\n        if (!(rpAssetType?.IsSubclassOf(typeof(RenderPipelineAsset)) ?? false))\n            throw new ArgumentException($\"Given {nameof(rpAssetType)} must derive from {nameof(RenderPipelineAsset)}\");\n        renderPipelineType = rpAssetType;\n    }\n\n    [Obsolete($\"ScriptableRenderPipelineExtensionAttribute.inUse is deprecated. Use SupportedOnRenderPipelineAttribute.isSupportedOnCurrentPipeline instead. #from(23.1) (UnityUpgradable) -> UnityEngine.Rendering.SupportedOnRenderPipelineAttribute.isSupportedOnCurrentPipeline\", false)]\n    public bool inUse\n        => GraphicsSettings.currentRenderPipelineAssetType == renderPipelineType;\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Inspector/ScriptableRenderPipelineExtensionAttribute.deprecated.cs#L1-L27","documentation":"Thrown by the ScriptableRenderPipelineExtensionAttribute constructor when the supplied rpAssetType is null or not a subclass of RenderPipelineAsset. The attribute (now deprecated) requires a concrete render pipeline asset type.","triggerScenarios":"Decorating a class with [ScriptableRenderPipelineExtension(typeof(SomeType))] where SomeType does not derive from RenderPipelineAsset. Passing an interface, abstract base, or unrelated type.","commonSituations":"Mistaking the render pipeline type for the asset type. Passing typeof(RenderPipeline) instead of typeof(RenderPipelineAsset). Migration from the deprecated attribute where the type argument was wrong.","solutions":["Pass a type that derives from RenderPipelineAsset (e.g. typeof(UniversalRenderPipelineAsset)).","Migrate to the replacement SupportedOnRenderPipelineAttribute per the deprecation message.","Verify rpAssetType?.IsSubclassOf(typeof(RenderPipelineAsset)) before applying the attribute."],"exampleFix":"// before\n[ScriptableRenderPipelineExtension(typeof(UniversalRenderPipeline))]\nclass MyFeature {}\n\n// after\n[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]\nclass MyFeature {}","handlingStrategy":"type-guard","validationCode":"bool ok = rpAssetType != null && rpAssetType.IsSubclassOf(typeof(RenderPipelineAsset));","typeGuard":"static bool IsValidRpAssetType(Type t) => t?.IsSubclassOf(typeof(RenderPipelineAsset)) ?? false;","tryCatchPattern":null,"preventionTips":["Pass a RenderPipelineAsset subclass.","Migrate to SupportedOnRenderPipelineAttribute."],"tags":["unity","editor","render-pipeline","attribute","type-mismatch","deprecated"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}