PrismLibrary/Prism · error · KeyNotFoundException
No Child Page was found with the key
Error message
No Child Page was found with the key '{selectedTab}'. What it means
Prism's PageNavigationService throws this when navigating to a TabbedPage with a deep-link segment (~/TabbedPage/ChildPage or ?selectedTab=...) and no child page in the tabbed page's Children collection matches the requested name. The match is done either by page type name or registration key; if neither matches, there is nothing to select as CurrentPage.
Solutions
- Make the deep-link segment exactly match the child page's class name or its registered navigation name (case matters via type Name comparison).
- Verify each tab child view is registered in the DI container with the name used in the URI (viewForNavigation).
- Inspect tabbedPage.Children at runtime to confirm which pages actually exist as tabs.
- If you add tabs dynamically, build the navigation URI from the actual child names instead of a hard-coded string.
Example fix
// before
await _navigationService.NavigateAsync("MainTabbedPage/DetailsPage");
// after - match the actual child page type/registration name
await _navigationService.NavigateAsync("MainTabbedPage/DetailPage"); Defensive patterns
Strategy: validation
Validate before calling
var childName = "DetailPage";
var hasChild = App.Current.MainPage is TabbedPage tp && tp.Children
.Any(c => c.GetType().Name == childName);
if (!hasChild) return; // skip or log the deep link
await _navigationService.NavigateAsync($"MainTabbedPage/{childName}"); Prevention
- Keep tab child registration names identical to the segment used in navigation URIs.
- Test deep links after every change to the tabbed page's children.
- Build deep-link segments from a shared constant, not string literals.
When it happens
Trigger: Calling navigationService.NavigateAsync("TabbedPage/SomeChild") or NavigateAsync("TabbedPage?selectedTab=SomeChild") where 'SomeChild' is neither the type name of any child page nor matches IsPage (registration name) for any tabbed child.
Common situations: Typo or casing mismatch in the child page name; child view was registered under a different name than the view class; tab child was added/removed in code or XAML so the deep link refers to a page that no longer exists; using the navigation URI path segment when only a registration name matches (or vice versa).
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Resources.NavigationModeNotAvailable
- Invalid Scope provided. The current scope Page Accessor…
- NavigationException.IConfirmNavigationReturnedFalse
- NavigationException.GoBackRequiresNavigationPage
- The Page is null.
AI-assisted analysis of PrismLibrary/Prism@358118cd64 (2026-09-15).
Data as JSON: /api/errors/e6dc4ae2e5d0236a.
Report an issue: GitHub.
Appendix: source
Thrown at src/Maui/Prism.Maui/Navigation/PageNavigationService.cs:1084
TabbedPageSelectRootTab(tabbedPage, selectedTab);
else if (segments.Count() > 1)
TabbedPageSelectNavigationChildTab(tabbedPage, segments.First(), segments.Last());
}
private void TabbedPageSelectRootTab(TabbedPage tabbedPage, string selectedTab)
{
var registry = Registry;
var selectRegistration = registry.Registrations.FirstOrDefault(x => x.Name == selectedTab);
Page child = null;
if (selectRegistration is null)
{
child = tabbedPage.Children.FirstOrDefault(x => x.GetType().Name == selectedTab) ??
throw new KeyNotFoundException($"No Registration found to select tab '{selectedTab}'.");
}
else
{
child = tabbedPage.Children.FirstOrDefault(x => IsPage(x, selectRegistration, selectedTab)) ??
throw new KeyNotFoundException($"No Child Page was found with the key '{selectedTab}'.");
}
tabbedPage.CurrentPage = child;
}
private void TabbedPageSelectNavigationChildTab(TabbedPage tabbedPage, string rootTab, string selectedTab)
{
var registry = Registry;
var rootRegistration = registry.Registrations.FirstOrDefault(x => x.Name == rootTab);
var selectRegistration = registry.Registrations.FirstOrDefault(x => x.Name == selectedTab);
var candidates = tabbedPage.Children
.OfType<NavigationPage>()
.Where(x => IsPage(x, rootRegistration, rootTab));
var child = candidates.SingleOrDefault(x => IsPage(x.RootPage, selectRegistration, selectedTab)) ??
candidates.SingleOrDefault(x => IsPage(x.CurrentPage, selectRegistration, selectedTab));
if (child is not null)View on GitHub (pinned to 358118cd64)