Closed aguacongas closed 3 years ago
Thanks again for the report and the great repro, @aguacongas!
I played around with the repo project that you provided a bit. At first, I figured that there was an interplay between the CascadingAuthenticationState
component and the rendering that occurs in the router. I played around with this by moving the cascading parameter component to the Found
render fragment. This didn't make much of a difference.
I also removed the lazy-loading logic altogether (by removing the OnNavigateAsync
parameter in the Router
and the property group int the project file) and still see reloads occurring when navigating between the the routes.
Eventually, I was able to resolve it by manually adding the lazily-loaded assemblies into the _lazyLoadedAssemblies
property that is passed to AdditionalAssemblies
.
I suspect that this and your other reported issue #27242 are related because the correct assemblies aren't populated into the additional assemblies list. Can you try the 5.0 nightly and see if that resolves the issue?
@captainsafia I confirm it's also fixed in 5.0.0-rtm.20512.8
Describe the bug
I've several satellites libraries containing pages I want to lazy load but each time I click on a navigation link the entire site page is reloaded except at the 1st click.
To Reproduce
The code is here
dotnet new blazorwasm -ho -au Individual
services.AddScoped<LazyAssemblyLoader>();
in LazyLoading.Server/Startup.csFurther technical details
dotnet --info
Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\
Host (useful for support): Version: 5.0.0-rc.2.20475.5 Commit: c5a3f49c88
.NET SDKs installed: 2.2.207 [C:\Program Files\dotnet\sdk] 3.1.300-preview-015095 [C:\Program Files\dotnet\sdk] 3.1.300 [C:\Program Files\dotnet\sdk] 3.1.403 [C:\Program Files\dotnet\sdk] 5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [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.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [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.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.9 [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]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download