From 95d1bc3852768591cfd21353fc449c0251d8eb7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Rozto=C4=8Dil?= Date: Wed, 7 May 2025 12:47:36 +0200 Subject: [PATCH] Register LazyAssemblyLoader to DI in AddInteractiveWebAssemblyComponents --- .../Microsoft.AspNetCore.Components.WebAssembly.Server.csproj | 1 + .../Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj b/src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj index a3d0e160329e..b3f42e28fe8a 100644 --- a/src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj +++ b/src/Components/WebAssembly/Server/src/Microsoft.AspNetCore.Components.WebAssembly.Server.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Components/WebAssembly/Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs b/src/Components/WebAssembly/Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs index 0dfb50ef840a..d783bede44f5 100644 --- a/src/Components/WebAssembly/Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs +++ b/src/Components/WebAssembly/Server/src/WebAssemblyRazorComponentsBuilderExtensions.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Endpoints.Infrastructure; using Microsoft.AspNetCore.Components.WebAssembly.Server; +using Microsoft.AspNetCore.Components.WebAssembly.Services; using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection; @@ -24,6 +25,7 @@ public static IRazorComponentsBuilder AddInteractiveWebAssemblyComponents(this I ArgumentNullException.ThrowIfNull(builder, nameof(builder)); builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); + builder.Services.TryAddScoped(); return builder; }