Skip to content

Commit c737189

Browse files
committed
Fix tests
1 parent 2cc6f6b commit c737189

18 files changed

+100
-40
lines changed

AspNetCore.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11773,11 +11773,14 @@ Global
1177311773
{B54A8F61-60DE-4AD9-87CA-D102F230678E} = {D30A658D-61F6-444B-9AC7-F66A1A1B86B6}
1177411774
{D30A658D-61F6-444B-9AC7-F66A1A1B86B6} = {5E46DC83-C39C-4E3A-B242-C064607F4367}
1177511775
{76C3E22D-092B-4E8A-81F0-DCF071BFF4CD} = {E22DD5A6-06E2-490E-BD32-88D629FD6668}
11776+
{A05652B3-953E-4915-9D7F-0E361D988815} = {0CE1CC26-98CE-4022-A81C-E32AAFC9B819}
1177611777
{AE4D272D-6F13-42C8-9404-C149188AFA33} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
1177711778
{5D438258-CB19-4282-814F-974ABBC71411} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
1177811779
{F5AE525F-F435-40F9-A567-4D5EC3B50D6E} = {5FE1FBC1-8CE3-4355-9866-44FE1307C5F1}
1177911780
{87D58D50-20D1-4091-88C5-8D88DCCC2DE3} = {6126DCE4-9692-4EE2-B240-C65743572995}
1178011781
{433F91E4-E39D-4EB0-B798-2998B3969A2C} = {6126DCE4-9692-4EE2-B240-C65743572995}
11782+
{8A021D6D-7935-4AB3-BB47-38D4FF9B0D13} = {6126DCE4-9692-4EE2-B240-C65743572995}
11783+
{757CBDE0-5D0A-4FD8-99F3-6C20BDDD4E63} = {5FE1FBC1-8CE3-4355-9866-44FE1307C5F1}
1178111784
{96EC4DD3-028E-6E27-5B14-08C21B07CE89} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
1178211785
{1BBD75D2-429D-D565-A98E-36437448E8C0} = {96EC4DD3-028E-6E27-5B14-08C21B07CE89}
1178311786
{C10EB67A-F43E-4B85-AEFD-7064C9B3DBE2} = {1BBD75D2-429D-D565-A98E-36437448E8C0}

src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,12 @@
4848
</ItemGroup>
4949

5050
<Target Name="_GetNuspecDependencyPackageVersions">
51-
<MSBuild Targets="_GetPackageVersionInfo"
52-
BuildInParallel="$(BuildInParallel)"
53-
Projects="
54-
../../Analyzers/src/Microsoft.AspNetCore.Components.Analyzers.csproj;
55-
../../../Security/Authorization/Core/src/Microsoft.AspNetCore.Authorization.csproj">
51+
<MSBuild Targets="_GetPackageVersionInfo" BuildInParallel="$(BuildInParallel)" Projects="&#xD;&#xA; ../../Analyzers/src/Microsoft.AspNetCore.Components.Analyzers.csproj;&#xD;&#xA; ../../../Security/Authorization/Core/src/Microsoft.AspNetCore.Authorization.csproj">
5652
<Output TaskParameter="TargetOutputs" ItemName="_ProjectPathWithVersion" />
5753
</MSBuild>
5854
<ItemGroup>
59-
<NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Components.Analyzers')->'componentAnalyzerVersion=%(PackageVersion)')" />
60-
<NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Authorization')->'authorizationVersion=%(PackageVersion)')" />
55+
<NuspecProperty Include="@(_ProjectPathWithVersion-&gt;WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Components.Analyzers')-&gt;'componentAnalyzerVersion=%(PackageVersion)')" />
56+
<NuspecProperty Include="@(_ProjectPathWithVersion-&gt;WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Authorization')-&gt;'authorizationVersion=%(PackageVersion)')" />
6157
</ItemGroup>
6258
</Target>
6359

@@ -89,4 +85,8 @@
8985
<InternalsVisibleTo Include="Components.TestServer" />
9086
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
9187
</ItemGroup>
88+
89+
<ItemGroup>
90+
<Folder Include="Infrastructure\" />
91+
</ItemGroup>
9292
</Project>

src/Components/Components/src/Infrastructure/ComponentStatePersistenceManager.cs renamed to src/Components/Components/src/PersistentState/ComponentStatePersistenceManager.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public ComponentStatePersistenceManager(ILogger<ComponentStatePersistenceManager
3636
/// <param name="serviceProvider"></param>
3737
public ComponentStatePersistenceManager(ILogger<ComponentStatePersistenceManager> logger, IServiceProvider serviceProvider) : this(logger)
3838
{
39-
_servicesRegistry = serviceProvider.GetService<PersistentServicesRegistry>();
40-
_servicesRegistry?.RegisterForPersistence(State);
39+
_servicesRegistry = new PersistentServicesRegistry(serviceProvider);
40+
_servicesRegistry.RegisterForPersistence(State);
4141
}
4242

4343
/// <summary>
@@ -107,6 +107,25 @@ async Task PersistState(IPersistentComponentStateStore store)
107107
}
108108
}
109109

110+
/// <summary>
111+
/// Initializes the render mode for state persisted by the platform.
112+
/// </summary>
113+
/// <param name="renderMode">The render mode to use for state persisted by the platform.</param>
114+
/// <exception cref="InvalidOperationException">when the render mode is already set.</exception>
115+
public void SetPlatformRenderMode(IComponentRenderMode renderMode)
116+
{
117+
if (_servicesRegistry == null)
118+
{
119+
return;
120+
}
121+
else if (_servicesRegistry?.RenderMode != null)
122+
{
123+
throw new InvalidOperationException("Render mode already set.");
124+
}
125+
126+
_servicesRegistry!.RenderMode = renderMode;
127+
}
128+
110129
private void InferRenderModes(Renderer renderer)
111130
{
112131
for (var i = 0; i < _registeredCallbacks.Count; i++)
@@ -151,7 +170,7 @@ internal Task PauseAsync(IPersistentComponentStateStore store)
151170
{
152171
List<Task>? pendingCallbackTasks = null;
153172

154-
for (var i = 0; i < _registeredCallbacks.Count; i++)
173+
for (var i = _registeredCallbacks.Count - 1; i >= 0; i--)
155174
{
156175
var registration = _registeredCallbacks[i];
157176

src/Components/Components/src/PersistentState/PersistentServicesRegistry.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using Microsoft.AspNetCore.Internal;
1313
using Microsoft.Extensions.DependencyInjection;
1414

15-
namespace Microsoft.AspNetCore.Components;
15+
namespace Microsoft.AspNetCore.Components.Infrastructure;
1616

1717
internal class PersistentServicesRegistry
1818
{
@@ -24,10 +24,11 @@ internal class PersistentServicesRegistry
2424
private List<PersistingComponentStateSubscription> _subscriptions = [];
2525
private static readonly ConcurrentDictionary<Type, PropertiesAccessor> _cachedAccessorsByType = new();
2626

27-
public PersistentServicesRegistry(
28-
IServiceProvider serviceProvider,
29-
IEnumerable<IPersistentComponentRegistration> registrations)
27+
public IComponentRenderMode? RenderMode { get; internal set; }
28+
29+
public PersistentServicesRegistry(IServiceProvider serviceProvider)
3030
{
31+
var registrations = serviceProvider.GetRequiredService<IEnumerable<IPersistentComponentRegistration>>();
3132
_serviceProvider = serviceProvider;
3233
_persistentServiceTypeCache = new PersistentServiceTypeCache();
3334
_registrations = [.. registrations.Distinct().Order()];
@@ -67,7 +68,7 @@ private void RestoreRegistrationsIfAvailable(PersistentComponentState state)
6768
[RequiresUnreferencedCode("Calls Microsoft.AspNetCore.Components.PersistentComponentState.TryTakeFromJson(String, Type, out Object)")]
6869
private static void RestoreInstanceState(object instance, Type type, PersistentComponentState state)
6970
{
70-
var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (Type runtimeType, Type declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
71+
var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
7172
foreach (var (key, propertyType) in accessors.KeyTypePairs)
7273
{
7374
if (state.TryTakeFromJson(key, propertyType, out var result))
@@ -81,7 +82,7 @@ private static void RestoreInstanceState(object instance, Type type, PersistentC
8182
[RequiresUnreferencedCode("Calls Microsoft.AspNetCore.Components.PersistentComponentState.PersistAsJson(String, Object, Type)")]
8283
private static void PersistInstanceState(object instance, Type type, PersistentComponentState state)
8384
{
84-
var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (Type runtimeType, Type declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
85+
var accessors = _cachedAccessorsByType.GetOrAdd(instance.GetType(), static (runtimeType, declaredType) => new PropertiesAccessor(runtimeType, declaredType), type);
8586
foreach (var (key, propertyType) in accessors.KeyTypePairs)
8687
{
8788
var (setter, getter) = accessors.GetAccessor(key);
@@ -116,17 +117,8 @@ internal void RegisterForPersistence(PersistentComponentState state)
116117
return;
117118
}
118119

119-
var comparer = EqualityComparer<IComponentRenderMode?>.Create((x, y) =>
120-
{
121-
var xType = x?.GetType();
122-
var yType = y?.GetType();
123-
return xType == yType;
124-
});
125-
126-
var renderModes = new HashSet<IComponentRenderMode?>(comparer);
127-
128120
var subscriptions = new List<PersistingComponentStateSubscription>(_registrations.Length + 1);
129-
for (var i = 1; i < _registrations.Length; i++)
121+
for (var i = 0; i < _registrations.Length; i++)
130122
{
131123
var registration = _registrations[i];
132124
var type = ResolveType(registration.Assembly, registration.FullTypeName);
@@ -136,10 +128,6 @@ internal void RegisterForPersistence(PersistentComponentState state)
136128
}
137129

138130
var renderMode = registration.GetRenderModeOrDefault();
139-
if (renderMode != null)
140-
{
141-
renderModes.Add(renderMode);
142-
}
143131

144132
var instance = _serviceProvider.GetRequiredService(type);
145133
subscriptions.Add(state.RegisterOnPersisting(() =>
@@ -149,13 +137,13 @@ internal void RegisterForPersistence(PersistentComponentState state)
149137
}, renderMode));
150138
}
151139

152-
foreach (var renderMode in renderModes)
140+
if(RenderMode != null)
153141
{
154142
subscriptions.Add(state.RegisterOnPersisting(() =>
155143
{
156144
state.PersistAsJson(_registryKey, _registrations);
157145
return Task.CompletedTask;
158-
}, renderMode));
146+
}, RenderMode));
159147
}
160148

161149
_subscriptions = subscriptions;
@@ -233,4 +221,16 @@ internal static IEnumerable<PropertyInfo> GetCandidateBindableProperties(
233221
return _underlyingAccessors.TryGetValue(key, out var result) ? result : default;
234222
}
235223
}
224+
225+
private class RenderModeComparer : IEqualityComparer<IComponentRenderMode?>
226+
{
227+
public static RenderModeComparer Instance { get; } = new RenderModeComparer();
228+
229+
public bool Equals(IComponentRenderMode? x, IComponentRenderMode? y)
230+
{
231+
return x?.GetType() == y?.GetType();
232+
}
233+
234+
public int GetHashCode([DisallowNull] IComponentRenderMode? obj) => obj?.GetHashCode() ?? 1;
235+
}
236236
}

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#nullable enable
2+
Microsoft.AspNetCore.Components.IComponentRenderMode.Includes(Microsoft.AspNetCore.Components.IComponentRenderMode! other) -> bool
23
Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager.ComponentStatePersistenceManager(Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager!>! logger, System.IServiceProvider! serviceProvider) -> void
4+
Microsoft.AspNetCore.Components.Infrastructure.ComponentStatePersistenceManager.SetPlatformRenderMode(Microsoft.AspNetCore.Components.IComponentRenderMode! renderMode) -> void
5+
Microsoft.AspNetCore.Components.Infrastructure.PersistentServicesRegistry
6+
Microsoft.AspNetCore.Components.Infrastructure.PersistentServicesRegistry.PersistentServicesRegistry(System.IServiceProvider! serviceProvider) -> void
37
Microsoft.AspNetCore.Components.SupplyParameterFromPersistentComponentStateAttribute
48
Microsoft.AspNetCore.Components.SupplyParameterFromPersistentComponentStateAttribute.SupplyParameterFromPersistentComponentStateAttribute() -> void
59
Microsoft.AspNetCore.Components.SupplyParameterFromPersistentComponentStateProviderServiceCollectionExtensions

src/Components/Components/src/SupplyParameterFromPersistentComponentStateProviderServiceCollectionExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using static Microsoft.AspNetCore.Internal.LinkerFlags;
66
using Microsoft.Extensions.DependencyInjection;
77
using Microsoft.Extensions.DependencyInjection.Extensions;
8+
using System.Runtime.InteropServices;
9+
using Microsoft.AspNetCore.Components.Infrastructure;
810

911
namespace Microsoft.AspNetCore.Components;
1012

@@ -49,8 +51,7 @@ public static IServiceCollection AddSupplyValueFromPersistentComponentStateProvi
4951
// Even as far as defaulting to Server (to avoid disclosing anything confidential to the client, even though is the Developer responsibility).
5052
// We can choose to fail when the service is not registered on DI.
5153
// We loop through the properties in the type and try to restore the properties that have SupplyParameterFromPersistentComponentState on them.
52-
services.TryAddScoped<PersistentServicesRegistry>();
53-
//services.TryAddEnumerable(ServiceDescriptor.Singleton(new PersistentServiceRenderMode(componentRenderMode)));
54+
5455
services.TryAddEnumerable(ServiceDescriptor.Singleton<IPersistentComponentRegistration>(new PersistentComponentRegistration<TService>(componentRenderMode)));
5556

5657
return services;

src/Components/ComponentsNoDeps.slnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"src\\Components\\Forms\\src\\Microsoft.AspNetCore.Components.Forms.csproj",
1616
"src\\Components\\Forms\\test\\Microsoft.AspNetCore.Components.Forms.Tests.csproj",
1717
"src\\Components\\Samples\\BlazorServerApp\\BlazorServerApp.csproj",
18+
"src\\Components\\Samples\\BlazorUnitedApp.Client\\BlazorUnitedApp.Client.csproj",
1819
"src\\Components\\Samples\\BlazorUnitedApp\\BlazorUnitedApp.csproj",
1920
"src\\Components\\Server\\src\\Microsoft.AspNetCore.Components.Server.csproj",
2021
"src\\Components\\Server\\test\\Microsoft.AspNetCore.Components.Server.Tests.csproj",
@@ -44,13 +45,15 @@
4445
"src\\Components\\WebView\\WebView\\test\\Microsoft.AspNetCore.Components.WebView.Test.csproj",
4546
"src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj",
4647
"src\\Components\\Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj",
48+
"src\\Components\\benchmarkapps\\BlazingPizza.Server\\BlazingPizza.Server.csproj",
4749
"src\\Components\\benchmarkapps\\Wasm.Performance\\ConsoleHost\\Wasm.Performance.ConsoleHost.csproj",
4850
"src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj",
4951
"src\\Components\\benchmarkapps\\Wasm.Performance\\TestApp\\Wasm.Performance.TestApp.csproj",
5052
"src\\Components\\test\\E2ETest\\Microsoft.AspNetCore.Components.E2ETests.csproj",
5153
"src\\Components\\test\\testassets\\BasicTestApp\\BasicTestApp.csproj",
5254
"src\\Components\\test\\testassets\\Components.TestServer\\Components.TestServer.csproj",
5355
"src\\Components\\test\\testassets\\Components.WasmMinimal\\Components.WasmMinimal.csproj",
56+
"src\\Components\\test\\testassets\\Components.WasmRemoteAuthentication\\Components.WasmRemoteAuthentication.csproj",
5457
"src\\Components\\test\\testassets\\ComponentsApp.App\\ComponentsApp.App.csproj",
5558
"src\\Components\\test\\testassets\\ComponentsApp.Server\\ComponentsApp.Server.csproj",
5659
"src\\Components\\test\\testassets\\GlobalizationWasmApp\\GlobalizationWasmApp.csproj",

src/Components/Endpoints/src/Forms/EndpointAntiforgeryStateProvider.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ internal void SetRequestContext(HttpContext context)
1616
_context = context;
1717
}
1818

19+
public override AntiforgeryRequestToken? CurrentToken {
20+
get
21+
{
22+
return field ??= GetAntiforgeryToken();
23+
}
24+
set;
25+
}
26+
1927
public override AntiforgeryRequestToken? GetAntiforgeryToken()
2028
{
2129
if (_context == null)

src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Microsoft.AspNetCore.Components.Rendering;
1313
using Microsoft.AspNetCore.Components.RenderTree;
1414
using Microsoft.AspNetCore.Components.Routing;
15+
using Microsoft.AspNetCore.Components.Web;
1516
using Microsoft.AspNetCore.Http;
1617
using Microsoft.AspNetCore.Http.Extensions;
1718
using Microsoft.AspNetCore.Routing;
@@ -113,6 +114,7 @@ internal static async Task InitializeStandardComponentServicesAsync(
113114
// It's important that this is initialized since a component might try to restore state during prerendering
114115
// (which will obviously not work, but should not fail)
115116
var componentApplicationLifetime = httpContext.RequestServices.GetRequiredService<ComponentStatePersistenceManager>();
117+
componentApplicationLifetime.SetPlatformRenderMode(RenderMode.InteractiveAuto);
116118
await componentApplicationLifetime.RestoreStateAsync(new PrerenderComponentApplicationStore());
117119

118120
if (componentType != null)

src/Components/Samples/BlazorUnitedApp/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
2323
app.UseHsts();
2424
}
25+
else
26+
{
27+
app.UseWebAssemblyDebugging();
28+
}
2529

2630
app.UseHttpsRedirection();
2731

src/Components/Samples/BlazorUnitedApp/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dotnetRunMessages": true,
2424
"launchBrowser": true,
2525
"applicationUrl": "https://localhost:7247;http://localhost:5265",
26-
//"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
26+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
2727
"environmentVariables": {
2828
"ASPNETCORE_ENVIRONMENT": "Development"
2929
}

src/Components/Server/src/Circuits/CircuitFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Security.Claims;
66
using Microsoft.AspNetCore.Components.Infrastructure;
77
using Microsoft.AspNetCore.Components.Routing;
8+
using Microsoft.AspNetCore.Components.Web;
89
using Microsoft.Extensions.DependencyInjection;
910
using Microsoft.Extensions.Logging;
1011
using Microsoft.Extensions.Options;
@@ -68,6 +69,7 @@ public async ValueTask<CircuitHost> CreateCircuitHostAsync(
6869
// This is the case on Blazor Web scenarios, which will initialize the state
6970
// when the first set of components is provided via an UpdateRootComponents call.
7071
var appLifetime = scope.ServiceProvider.GetRequiredService<ComponentStatePersistenceManager>();
72+
appLifetime.SetPlatformRenderMode(RenderMode.InteractiveServer);
7173
await appLifetime.RestoreStateAsync(store);
7274
}
7375

src/Components/Server/src/Circuits/CircuitHost.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Security.Claims;
77
using Microsoft.AspNetCore.Components.Authorization;
88
using Microsoft.AspNetCore.Components.Infrastructure;
9+
using Microsoft.AspNetCore.Components.Web;
910
using Microsoft.AspNetCore.SignalR;
1011
using Microsoft.Extensions.DependencyInjection;
1112
using Microsoft.Extensions.Logging;
@@ -757,6 +758,7 @@ internal Task UpdateRootComponents(
757758
// We only do this if we have no root components. Otherwise, the state would have been
758759
// provided during the start up process
759760
var appLifetime = _scope.ServiceProvider.GetRequiredService<ComponentStatePersistenceManager>();
761+
appLifetime.SetPlatformRenderMode(RenderMode.InteractiveServer);
760762
await appLifetime.RestoreStateAsync(store);
761763
}
762764

src/Components/Shared/src/DefaultAntiforgeryStateProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Components.Forms;
66
internal class DefaultAntiforgeryStateProvider : AntiforgeryStateProvider
77
{
88
[SupplyParameterFromPersistentComponentState]
9-
public AntiforgeryRequestToken? CurrentToken { get; set; }
9+
public virtual AntiforgeryRequestToken? CurrentToken { get; set; }
1010

1111
/// <inheritdoc />
1212
public override AntiforgeryRequestToken? GetAntiforgeryToken() => CurrentToken;

src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Diagnostics.CodeAnalysis;
55
using System.Reflection.Metadata;
66
using Microsoft.AspNetCore.Components.Infrastructure;
7+
using Microsoft.AspNetCore.Components.Web;
78
using Microsoft.AspNetCore.Components.Web.Infrastructure;
89
using Microsoft.AspNetCore.Components.WebAssembly.HotReload;
910
using Microsoft.AspNetCore.Components.WebAssembly.Infrastructure;
@@ -135,6 +136,7 @@ internal async Task RunAsyncCore(CancellationToken cancellationToken, WebAssembl
135136
new PrerenderComponentApplicationStore(_persistedState) :
136137
new PrerenderComponentApplicationStore();
137138

139+
manager.SetPlatformRenderMode(RenderMode.InteractiveWebAssembly);
138140
await manager.RestoreStateAsync(store);
139141

140142
if (MetadataUpdater.IsSupported)

0 commit comments

Comments
 (0)