{"record":{"id":"e9ef0c0f847dd2ca","repo":"dotnet/aspnetcore","slug":"the-router-component-requires-a-value-for-the-para","errorCode":null,"errorMessage":"The Router component requires a value for the parameter AppAssembly.","messagePattern":"The Router component requires a value for the parameter AppAssembly\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Components/src/Routing/Router.cs","lineNumber":127,"sourceCode":"        _locationAbsolute = NavigationManager.Uri;\n        NavigationManager.LocationChanged += OnLocationChanged;\n        NavigationManager.OnNotFound += OnNotFound;\n        RoutingStateProvider = ServiceProvider.GetService<IRoutingStateProvider>();\n\n        if (HotReloadManager.IsSupported)\n        {\n            HotReloadManager.Default.OnDeltaApplied += ClearRouteCaches;\n        }\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","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/Components/Components/src/Routing/Router.cs#L109-L145","documentation":"Thrown in Router.SetParametersAsync. AppAssembly (marked [EditorRequired]) is the assembly the Router scans for [Route]/@page components. If it is null after parameters are set, the Router has nothing to scan and cannot build a route table, so it refuses to render.","triggerScenarios":"Rendering <Router> without an AppAssembly parameter, or binding it to a null expression. The standard usage is <Router AppAssembly=\"@typeof(Program).Assembly\" ...>.","commonSituations":"A hand-written App.razor where AppAssembly was deleted or never added; binding AppAssembly to an expression that evaluates to null; splitting into Client/Server projects and forgetting to set AppAssembly on the Router in one of them.","solutions":["Set AppAssembly on the Router: <Router AppAssembly=\"@typeof(Program).Assembly\">.","If pages live in another assembly, also pass AdditionalAssemblies.","For Blazor Web App with .Client project, point AppAssembly at the client project's assembly (e.g., @typeof(_Imports).Assembly or the client Program)."],"exampleFix":"<!-- before -->\n<Router Found=\"@Found\" NotFoundPage=\"@typeof(NotFound)\">\n\n<!-- after -->\n<Router AppAssembly=\"@typeof(Program).Assembly\"\n       Found=\"@Found\" NotFoundPage=\"@typeof(NotFound)\">","handlingStrategy":"validation","validationCode":"// In App.razor, always set AppAssembly; guard against null at the markup level.\n<Router AppAssembly=\"@(AppAssembly ?? throw new InvalidOperationException(nameof(Router.AppAssembly)))\"\n        Found=\"@Found\" ...>\n@code { static Assembly AppAssembly => typeof(Program).Assembly; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set AppAssembly=\"@typeof(Program).Assembly\" on <Router>.","Treat AppAssembly as [EditorRequired]; the IDE warns if it is missing.","When splitting Client/Server, confirm each Router points at the assembly containing its pages."],"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"}