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; } diff --git a/src/Components/WebAssembly/WebAssembly/src/Properties/AssemblyInfo.cs b/src/Components/WebAssembly/WebAssembly/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..03836e5f660f --- /dev/null +++ b/src/Components/WebAssembly/WebAssembly/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Components.WebAssembly.Services.LazyAssemblyLoader))] diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs b/src/JSInterop/Microsoft.JSInterop/src/LazyAssemblyLoader.cs similarity index 100% rename from src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs rename to src/JSInterop/Microsoft.JSInterop/src/LazyAssemblyLoader.cs diff --git a/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt b/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt index 3270d74b01a0..46eac67e5bb9 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt +++ b/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt @@ -1,6 +1,9 @@ #nullable enable abstract Microsoft.JSInterop.JSInProcessRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string? abstract Microsoft.JSInterop.JSRuntime.BeginInvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> void +Microsoft.AspNetCore.Components.WebAssembly.Services.LazyAssemblyLoader +Microsoft.AspNetCore.Components.WebAssembly.Services.LazyAssemblyLoader.LazyAssemblyLoader(Microsoft.JSInterop.IJSRuntime! jsRuntime) -> void +Microsoft.AspNetCore.Components.WebAssembly.Services.LazyAssemblyLoader.LoadAssembliesAsync(System.Collections.Generic.IEnumerable! assembliesToLoad) -> System.Threading.Tasks.Task!>! Microsoft.JSInterop.IJSInProcessObjectReference.GetValue(string! identifier) -> TValue Microsoft.JSInterop.IJSInProcessObjectReference.InvokeNew(string! identifier, object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! Microsoft.JSInterop.IJSInProcessObjectReference.SetValue(string! identifier, TValue value) -> void