dotnet / dotnet/linker

Blazor client side Unable to find a default constructor to use for type System.IdentityModel.Tokens.Jwt.JwtPayload.

Open
#870 5 comments 6 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

_From @partyelite on Tuesday, December 17, 2019 12:31:24 PM_

### Describe the bug
I'm using blazor client side and System.IdentityModel.Tokens.Jwt package v5.6.0.
When calling ReadJwtToken method on JwtSecurityTokenHandler I get the following exception

`Newtonsoft.Json.JsonSerializationException: Unable to find a default constructor to use for type System.IdentityModel.Tokens.Jwt.JwtPayload.`

I believe it has something to do with linker because if I add a redundant call to
`new System.IdentityModel.Tokens.Jwt.JwtPayload()`
in App.razor OnInitialized method it works.

I have tried adding

` `

to my Linker.xml file but that didn't help.

_Copied from original issue: aspnet/AspNetCore#17920_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.