{"record":{"id":"6e7c0dfdae0f1222","repo":"stride3d/stride","slug":"unable-to-find-registered-parameterkey-0","errorCode":null,"errorMessage":"Unable to find registered ParameterKey [{0}]","messagePattern":"Unable to find registered ParameterKey \\[(.+?)\\]","errorType":"exception","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Serializers/ParameterKeySerializer.cs","lineNumber":29,"sourceCode":"namespace Stride.Assets.Serializers\n{\n    /// <summary>\n    /// A Yaml serializer for <see cref=\"ParameterKey\"/>\n    /// </summary>\n    [YamlSerializerFactory(YamlAssetProfile.Name)]\n    internal class ParameterKeySerializer : AssetScalarSerializerBase\n    {\n        public override bool CanVisit(Type type)\n        {\n            return typeof(ParameterKey).IsAssignableFrom(type);\n        }\n\n        public override object ConvertFrom(ref ObjectContext objectContext, Scalar fromScalar)\n        {\n            var parameterKey = ParameterKeys.FindByName(fromScalar.Value);\n            if (parameterKey == null)\n            {\n                throw new YamlException(fromScalar.Start, fromScalar.End, \"Unable to find registered ParameterKey [{0}]\".ToFormat(fromScalar.Value));\n            }\n            return parameterKey;\n        }\n\n        protected override void WriteScalar(ref ObjectContext objectContext, ScalarEventInfo scalar)\n        {\n            // TODO: if ParameterKey is written to an object, It will not serialized a tag\n            scalar.Tag = null;\n            scalar.IsPlainImplicit = true;\n            base.WriteScalar(ref objectContext, scalar);\n        }\n\n        public override string ConvertTo(ref ObjectContext objectContext)\n        {\n            return ((ParameterKey)objectContext.Instance).Name;\n        }\n    }\n}","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Serializers/ParameterKeySerializer.cs#L11-L47","documentation":"ParameterKeySerializer.ConvertFrom resolves a YAML scalar to a ParameterKey via ParameterKeys.FindByName. If no key with that name is registered in the global ParameterKey registry, a YamlException is thrown. It means the referenced key was never registered (assembly not loaded) or is misspelled in the asset.","triggerScenarios":"Deserializing a YAML asset that references a shader/parameter key name which is not present in the registry at that moment; e.g. a stale key name after renaming a ParameterKey in code, or a plugin/assembly containing the key not being loaded.","commonSituations":"Renaming or deleting a ParameterKey after assets referenced it; key defined in an assembly not referenced by the serializer's scan; typo in the asset's YAML value.","solutions":["Fix the key name in the asset YAML to exactly match a registered ParameterKey.","Ensure the assembly defining the ParameterKey is referenced and scanned (ParameterKeys.FindByName registry).","Rebuild assets after any rename of parameter keys so the cached YAML is regenerated."],"exampleFix":"// before (asset yaml)\nkey: MyShaders.OldKeyName\n\n// after (match the registered key)\nkey: MyShaders.ActualKeyName","handlingStrategy":"validation","validationCode":"if (ParameterKeys.FindByName(keyName) == null)\n    throw new ArgumentException($\"Unknown ParameterKey '{keyName}'\");","typeGuard":null,"tryCatchPattern":"// catch YamlException from asset loading and report the offending key name\ncatch (YamlException ex) { log.Error($\"ParameterKey not registered: {ex.Message}\"); }","preventionTips":["Regenerate assets after renaming ParameterKeys.","Reference all assemblies that define parameter keys."],"tags":["yaml","resource-not-found","parameters"],"backgroundTag":"resource-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}