Shell Navigation doesn't render the next page on Android. Shell Current State shows DnsSafeHost - System Invalid Exception.

Khadeeja Madathil 0 Reputation points
2024-07-02T15:49:46.3433333+00:00

Shell Navigation doesn't render the next page on Android. Shell Current State shows DnsSafeHost - System Invalid Exception.

The steps -

Have set the AppShell as MainPage

MainPage = new AppShell();

Routing registered for second page on AppShell.xaml.cs

Routing.RegisterRoute("secondpage", typeof(SecondPage));

  1. From the initial page, tries to navigate to next page on button click

private void Button_OnClicked(object sender, EventArgs e) { Shell.Current.GoToAsync("secondpage"); }

Behavior -

The breakpoint redirects to the second page. But UI is never rendered.

When checked the current state of the Shell, I get the following result -

Shell Navigation doesn't render the next page on Android. Shell Current State shows DnsSafeHost - System Invalid Exception.

The steps -

Have set the AppShell as MainPage

MainPage = new AppShell();

Routing registered for second page on AppShell.xaml.cs

Routing.RegisterRoute("secondpage", typeof(SecondPage));

  1. From the initial page, tries to navigate to next page on button click

private void Button_OnClicked(object sender, EventArgs e)
{
Shell.Current.GoToAsync("secondpage");
}

Behavior -

The breakpoint redirects to the second page. But UI is never rendered.

When checked the current state of the Shell, I get the following result -

Screenshot 2024-07-02 at 16.38.12

Dns safe host - System Invalid Exception.

When checked the state when just after setting Shell, gives the same result. No crashes or errors. Just the navigation is blocked.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,134 questions
0 comments No comments
{count} votes