{"record":{"id":"56144aa304e9c9a2","repo":"dotnet/aspnetcore","slug":"the-router-component-requires-a-value-for-the-para-56144a","errorCode":null,"errorMessage":"The Router component requires a value for the parameter Found.","messagePattern":"The Router component requires a value for the parameter Found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/Routing/Router.cs","lineNumber":135,"sourceCode":"        }\n    }\n\n    /// <inheritdoc />\n    public async Task SetParametersAsync(ParameterView parameters)\n    {\n        parameters.SetParameterProperties(this);\n\n        if (AppAssembly == null)\n        {\n            throw new InvalidOperationException($\"The {nameof(Router)} component requires a value for the parameter {nameof(AppAssembly)}.\");\n        }\n\n        // Found content is mandatory, because even though we could use something like <RouteView ...> as a\n        // reasonable default, if it's not declared explicitly in the template then people will have no way\n        // to discover how to customize this (e.g., to add authorization).\n        if (Found == null)\n        {\n            throw new InvalidOperationException($\"The {nameof(Router)} component requires a value for the parameter {nameof(Found)}.\");\n        }\n\n        if (NotFoundPage != null)\n        {\n#pragma warning disable CS0618 // Type or member is obsolete\n            if (NotFound != null)\n            {\n                throw new InvalidOperationException($\"Setting {nameof(NotFound)} and {nameof(NotFoundPage)} properties simultaneously is not supported. Use either {nameof(NotFound)} or {nameof(NotFoundPage)}.\");\n            }\n#pragma warning restore CS0618 // Type or member is obsolete\n            if (!typeof(IComponent).IsAssignableFrom(NotFoundPage))\n            {\n                throw new InvalidOperationException($\"The type {NotFoundPage.FullName} \" +\n                    $\"does not implement {typeof(IComponent).FullName}.\");\n            }\n\n            var routeAttributes = NotFoundPage.GetCustomAttributes(typeof(RouteAttribute), inherit: true);\n            if (routeAttributes.Length == 0)","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/Routing/Router.cs#L117-L153","documentation":"Thrown in Router.SetParametersAsync. Found ([EditorRequired]) is the RenderFragment<RouteData> rendered when a route matches — the Router cannot proceed without it because there is no safe default for how to display a matched page (callers need to customize it, e.g., to add authorization via AuthorizeRouteView). A null Found aborts startup.","triggerScenarios":"Rendering <Router> without a <Found> child template. The Found template is normally where <RouteView> (or <AuthorizeRouteView>) is placed.","commonSituations":"A partially-written App.razor missing the <Found> block; refactoring that removed Found while tweaking layout; a templating mistake where Found was renamed.","solutions":["Add a <Found Context=\"routeData\"> template containing <RouteView RouteData=\"@routeData\" DefaultLayout=\"...\" />.","For authorized pages, use <AuthorizeRouteView RouteData=\"@routeData\" .../> inside Found.","Confirm the Found parameter is bound and not null before the Router renders."],"exampleFix":"<!-- before -->\n<Router AppAssembly=\"@typeof(Program).Assembly\">\n</Router>\n\n<!-- after -->\n<Router AppAssembly=\"@typeof(Program).Assembly\">\n    <Found Context=\"routeData\">\n        <RouteView RouteData=\"@routeData\" DefaultLayout=\"@typeof(MainLayout)\" />\n    </Found>\n</Router>","handlingStrategy":"validation","validationCode":"// Provide a <Found> template; the [EditorRequired] nature means it must be set.\n<Router AppAssembly=\"@typeof(Program).Assembly\">\n    <Found Context=\"routeData\">\n        <RouteView RouteData=\"@routeData\" DefaultLayout=\"@typeof(MainLayout)\" />\n        <FocusOnNavigate RoutePath=\"@routeData.PageType.FullName\" />\n    </Found>\n</Router>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a <Found Context=\"routeData\"> template on <Router>.","For auth, put <AuthorizeRouteView> inside Found.","Treat Found as [EditorRequired] — never ship a Router without it."],"tags":["blazor","routing","router","missing-parameter","configuration"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}