diff --git a/aspnetcore/blazor/webassembly-lazy-load-assemblies.md b/aspnetcore/blazor/webassembly-lazy-load-assemblies.md index a89174db8f..a0054cb667 100644 --- a/aspnetcore/blazor/webassembly-lazy-load-assemblies.md +++ b/aspnetcore/blazor/webassembly-lazy-load-assemblies.md @@ -592,16 +592,18 @@ The assembly is assigned to lazyLoadedAssemblies = new(); + private bool grantImaharaRobotControlsAssemblyLoaded; private async Task OnNavigateAsync(NavigationContext args) { try { - if (args.Path == "robot") + if ((args.Path == "robot") && !grantImaharaRobotControlsAssemblyLoaded) { var assemblies = await AssemblyLoader.LoadAssembliesAsync( new[] { "GrantImaharaRobotControls.{FILE EXTENSION}" }); lazyLoadedAssemblies.AddRange(assemblies); + grantImaharaRobotControlsAssemblyLoaded = true; } } catch (Exception ex) @@ -644,16 +646,18 @@ The assembly is assigned to lazyLoadedAssemblies = new List(); + private bool grantImaharaRobotControlsAssemblyLoaded; private async Task OnNavigateAsync(NavigationContext args) { try { - if (args.Path == "robot") + if ((args.Path == "robot") && !grantImaharaRobotControlsAssemblyLoaded) { var assemblies = await AssemblyLoader.LoadAssembliesAsync( new[] { "GrantImaharaRobotControls.{FILE EXTENSION}" }); lazyLoadedAssemblies.AddRange(assemblies); + grantImaharaRobotControlsAssemblyLoaded = true; } } catch (Exception ex)