Skip to content

Blazor preserving prerended state does not seem to work #35605

@dannyBies

Description

@dannyBies

Describe the bug

I'm following the guide at https://docs.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-6.0&pivots=server#preserve-prerendered-state to preserve the prerendered component state. However when I try to run the application I get the following error:
image

To Reproduce

1 -> Create new Blazor Server template
2 -> Add the <preserve-component-state /> below <script src="_framework/blazor.server.js"></script> in _Host.cshtml
3 -> Change the code in FetchDate.razor to the code mentioned in https://docs.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-6.0&pivots=server#preserve-prerendered-state.
4 -> Run application

It seems this issue also occurs using the hosted webassembly template but I'm not familiar enough with that approach to be 100% sure of that.

A few more potential issuesI have noticed:

Further technical details

ASP.NET Core version 6.0.100-preview.7.21379.14
Visual studio community 2022 preview 3.1

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-prerenderingIssues related to prerendering blazor components

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions