{"record":{"id":"d2f8ebc829f066d4","repo":"dotnet/aspnetcore","slug":"unknown-parameter-param-name","errorCode":null,"errorMessage":"Unknown parameter '{param.Name}'","messagePattern":"Unknown parameter '(.+?)'","errorType":"exception","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/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/Components/Components/src/Sections/SectionContent.cs#L89-L121","documentation":"SectionContent uses a hand-written SetParameterValues loop that switches on parameter name and throws ArgumentException for any unrecognized name. This is because SectionContent has an internal parameter (IsDefaultContent) it cannot expose through the auto-generated SetParameterProperties path, so unknown parameter names surface explicitly rather than being silently ignored. The throw identifies the offending parameter name.","triggerScenarios":"Passing a parameter to <SectionContent> whose name is not one of: SectionName, SectionId, IsDefaultContent, ChildContent. Causes include typos, renamed parameters after a version upgrade, or tools that emit arbitrary attributes.","commonSituations":"Typos in markup (e.g. SectionNamed instead of SectionName); upgrading Blazor across a rename of an internal parameter; using a section component that has a different parameter surface than expected; reflected/programmatic SetParametersAsync calls that pass a stale parameter dictionary.","solutions":["Check the exception for the unknown parameter name and fix the markup to match a real SectionContent parameter (SectionName, SectionId, IsDefaultContent, ChildContent).","After upgrading Blazor, audit SectionContent usages for parameters that may have been renamed.","If building parameter dictionaries programmatically, filter to the known parameter set."],"exampleFix":"// before\n<SectionContent SectionNamed=\"alerts\">...</SectionContent>  // typo 'SectionNamed'\n// after\n<SectionContent SectionName=\"alerts\">...</SectionContent>","handlingStrategy":"type-guard","validationCode":"// Whitelist known parameter names before calling SetParametersAsync on SectionContent.\nstatic readonly HashSet<string> Known = new() { \"SectionName\", \"SectionId\", \"IsDefaultContent\", \"ChildContent\" };\nvar filtered = parameters.ToDictionary().Where(kv => Known.Contains(kv.Key)).ToArray();","typeGuard":"static bool IsKnownSectionContentParameter(string name)\n    => name is \"SectionName\" or \"SectionId\" or \"IsDefaultContent\" or \"ChildContent\";","tryCatchPattern":null,"preventionTips":["Use code completion / intellisense to set SectionContent parameters; avoid hand-typing names.","After upgrading Blazor, review SectionContent usages for renamed parameters.","When building parameter dictionaries programmatically, filter to the known set."],"tags":["blazor","sections","sectioncontent","parameters","argumentexception"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}