Skip to content

Build in AuthenticationStateProvider breaks after trimming #56207

Closed
@iits-timon-holzhaeuser

Description

@iits-timon-holzhaeuser

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Just tried the new API from #52769 and replaced my implementation with it.
After the trimming during dotnet publish I get an exception as soon as the app tries to hand over to WebAssembly:
Screenshot 2024-06-12 205246

May relate to #52947 as I noticed that the AuthenticationStateData is using a IList<KeyValuePair<string, string>> but that is only my wild guess.

I'm not using the JSON Source Code Generation Serialization

After removing this line on client:

builder.Services.AddAuthenticationStateDeserialization();

And this line on the server side:

.AddAuthenticationStateSerialization(options => options.SerializeAllClaims = true)

The app worked again as expected.

Expected Behavior

The handover to Web Assembly should work flawless.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.0-preview.5.24306.7

Anything else?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions