-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble with NavigateTo within OnInitialized #13582
Comments
Thanks for contacting us, @katiep23. |
You can try to turn the |
Nobody has "NavigationException" in their exception settings. |
If you don't add it, the default behavior is to break on the first chance exception and that's what your colleagues are experiencing. |
So I added it to mine to "break when thrown" & it's still not catching that exception. Is there any reason the exception is being thrown in the first place? If we move "uriHelper.NavigateTo("/Account/Login");" to "OnAfterRender' instead, nobody has the issue. |
@SteveSandersonMS thoughts? |
I was able to use the exception config to control whether or not this causes the debugger to break. Here's my config. Notice that the checkbox is checked, unlike in the screenshot in an earlier comment: With the checkbox checked, the debugger does stop when the redirection occurs. This is probably not the config you want. Everyone on the team should ensure this checkbox is unchecked (and that VS is not configured to break for all Common Language Runtime exceptions), so that it doesn't interfere with page loading all the time. |
Yes. When you tell the navigation manager to navigate, the system needs to know to stop the whole prerendering process that is taking place. This is a normal part of the redirect-during-prerendering behavior. |
Thank you for contacting us. Due to no activity on this issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue. |
Have following code in my MainLayout.Razor page:
It worked fine for me, but for others on my team, it gave them "Microsoft.AspNetCore.Components.NavigationException: 'Exception of type 'Microsoft.AspNetCore.Components.NavigationException' was thrown.'" on the uriHelper.NavigateTo line when building.
I think this is related to #11591. It shows it resolved. Is there possibly an update the rest of my team does not have? Everybody is using latest version of Visual Studio 2019 Preview & .Net Core 3.0 Preview 8
The text was updated successfully, but these errors were encountered: