Blazor-Blogs
Blazor-Blogs copied to clipboard
Retargeting Blazor-Blogs to .NET 10 failed with a System.InvalidOperationException at runtime.
Just a heads up !
After retargeting Blazor-Blogs to .NET10 using dotnet-sdk-10.0.100-preview.5.25272.110, the app throws the following errors at runtime:
System.InvalidOperationException: IdentityRedirectManager can only be used during static rendering System.InvalidOperationException: 'RemoteNavigationManager' already initialized
Upon investigation, the issue was caused by the change described in the following release note: https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-10.0?view=aspnetcore-9.0#navigationmanagernavigateto-no-longer-throws-a-navigationexception
Calling NavigationManager.NavigateTo during static SSR no longer throws a NavigationException. Instead, it behaves consistently with interactive rendering by performing the navigation without throwing an exception. Code that relied on NavigationException being thrown should be updated. For example, in the default Blazor Identity UI, the IdentityRedirectManager previously threw an InvalidOperationException after calling RedirectTo to ensure it wasn't invoked during interactive rendering. This exception and the [DoesNotReturn] attributes should now be removed.
For more details, please refer to dotnet/aspnetcore#62171.
Thanks for this! Will do then when .NET10 is released.