OnParametersSetAsync is being invoked multiple times in certain scenarios
See original GitHub issueDescribe the bug
I have a page which can be visited through out a parameter. in my case
@page "/Test{CustomerId:int}"
When I visit the page with a direct link within my blazor project OnParametersSetAsync() is invoked correctly one time. However, when I visit the page manually throughout the URL bar in my browser, it gets invoked multiple times. In another project of mine, this even chains up with every page refresh but unfortunately I was not able to find out why this is happening yet.
To Reproduce
I Created this small repo which shows exactly what I mean. https://github.com/MarvinKlein1508/Blazor-ParametersSetAsync
Further technical details
- ASP.NET Core version 5.0.2
 - VS 2020 v 16.4.8
 
.NET SDK (gemäß “global.json”): Version: 5.0.102 Commit: 71365b4d42
Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.102\
Host (useful for support): Version: 5.0.2 Commit: cb5f173b96
.NET SDKs installed: 5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk] 5.0.102 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0-rc.2.20475.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Issue Analytics
- State:
 - Created 3 years ago
 - Comments:15 (7 by maintainers)
 

Top Related StackOverflow Question
On
_Host.cshtml@MarvinKlein1508 can you point me out to where in your repro this happens?