Blazor SSR Navigate does not work inside try/catch block #57311
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue for this?
Describe the bug
In a Blazor SSR app, NavigationManager.NavigateTo always throws an exception.
The problem with this approach is when debugging
async await
methods in Visual Studio the debugger does not stop to show this exception, so the developer is unaware.It is therefore likely the developer will include the call to NavigateTo within a try block, and then navigation fails...
Expected Behavior
It should not throw an exception.
I should be able to write the same code as I would for Server or WASM Blazor apps.
Steps To Reproduce
Exceptions (if any)
Microsoft.AspNetCore.Components.NavigationException
.NET Version
8.0.303
Anything else?
No response
The text was updated successfully, but these errors were encountered: