Skip to content

Upgrade guide change - NavigationException removal #61811

@ilonatommy

Description

@ilonatommy

PR: #61306.
Released in: 10.0.0-preview4.

Change description

Previously:

  • NavigationManager.Redirect in SSR was throwing an internal exception, interrupting the call stack execution.
  • Consequences: no code after the redirection would be reached and wrapping the redirection call into a try-catch could catch the internal exception, breaking the redirection mechanism.

Currently:

  • NavigationManager.Redirect in SSR rises a redirection event that the renderer is subscribed to. Code execution flow is uninterupted.
  • Consequences: code after redirection is executed.

Fallback to the previous way of working:

AppContext.SetSwitch("Microsoft.AspNetCore.Components.Endpoints.NavigationManager.EnableThrowNavigationException", isEnabled: true);

@guardrex

Metadata

Metadata

Assignees

Labels

DocsThis issue tracks updating documentationarea-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions