{"record":{"id":"d2f8ebc829f066d4","repo":"dotnet/aspnetcore","slug":"unknown-parameter-param-name","errorCode":null,"errorMessage":"Unknown parameter '{param.Name}'","messagePattern":"Unknown parameter '(.+?)'","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/Sections/SectionContent.cs","lineNumber":107,"sourceCode":"    {\n        foreach (var param in parameters)\n        {\n            switch (param.Name)\n            {\n                case nameof(SectionContent.SectionName):\n                    SectionName = (string)param.Value;\n                    break;\n                case nameof(SectionContent.SectionId):\n                    SectionId = param.Value;\n                    break;\n                case nameof(SectionContent.IsDefaultContent):\n                    IsDefaultContent = (bool)param.Value;\n                    break;\n                case nameof(SectionContent.ChildContent):\n                    ChildContent = (RenderFragment)param.Value;\n                    break;\n                default:\n                    throw new ArgumentException($\"Unknown parameter '{param.Name}'\");\n            }\n        }\n    }\n\n    /// <inheritdoc/>\n    public void Dispose()\n    {\n        if (_registeredIdentifier is not null)\n        {\n            _registry.RemoveProvider(_registeredIdentifier, this);\n        }\n    }\n}\n","sourceCodeStart":89,"sourceCodeEnd":121,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/Sections/SectionContent.cs#L89-L121","documentation":"SectionContent.SetParameterValues manually switches on known parameter names (SectionName, SectionId, IsDefaultContent, ChildContent) instead of using ParameterView.SetParameterProperties. The default branch throws ArgumentException for any unrecognized name. Unlike the framework's automatic parameter binder, this strict switch gives no tolerance for typos or casing differences.","triggerScenarios":"Passing an unknown attribute in markup, e.g. <SectionContent Section=\"header\"> (misspelled as 'Section' instead of 'SectionName'), or splatting a dictionary whose keys include an extra entry. The strict switch fires on the first unknown parameter encountered during iteration.","commonSituations":"Typo in the attribute name (Section vs SectionName, Id vs SectionId); copy-paste from a SectionOutlet that uses different parameter casing; a splatted dictionary carrying stale keys; attempting to pass IsDefaultContent from user markup (it is internal-only).","solutions":["Correct the attribute name to one of: SectionName, SectionId, or ChildContent (IsDefaultContent is internal and set by the framework).","Match casing exactly — Razor is case-sensitive for these switch keys.","Inspect any splatted dictionary passed via @attributes and remove keys that are not valid SectionContent parameters.","Avoid passing IsDefaultContent from markup; default content is configured via the framework's SectionOutlet default-content API, not user parameters."],"exampleFix":"// before\n<SectionContent Section=\"header\" ChildContent=\"@frag\">\n</SectionContent>\n\n// after\n<SectionContent SectionName=\"header\">\n    @frag\n</SectionContent>","handlingStrategy":"validation","validationCode":"// Whitelist SectionContent attributes before splatting\nvar allowed = new HashSet<string>(StringComparer.Ordinal)\n{\n    nameof(SectionContent.SectionName),\n    nameof(SectionContent.SectionId),\n    nameof(SectionContent.ChildContent)\n};\nforeach (var key in attributes.Keys.ToList())\n    if (!allowed.Contains(key)) attributes.Remove(key);","typeGuard":"static bool IsValidSectionContentParam(string name) =>\n    name is nameof(SectionContent.SectionName)\n         or nameof(SectionContent.SectionId)\n         or nameof(SectionContent.ChildContent);","tryCatchPattern":null,"preventionTips":["Never splat unfiltered dictionaries into SectionContent.","Use nameof() for attribute keys to avoid typos.","Do not attempt to set IsDefaultContent from user markup — it is internal-only."],"tags":["blazor","sections","sectioncontent","parameters","argumentexception"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}