IdentityModel.OidcClient.Samples icon indicating copy to clipboard operation
IdentityModel.OidcClient.Samples copied to clipboard

The type initializer for 'System.Text.Json.JsonSerializer' threw an exception

Open dhruvgohiloo7 opened this issue 4 years ago • 5 comments
trafficstars

After updating IdentityModel to 5.1.0 and IdentityModel.OidcClient to 4.0.0, I started getting below exception (only in iOS)

Error loading discovery document: Error connecting to https://auth.example.org/.well-known/openid-configuration/jwks. The type initializer for 'System.Text.Json.JsonSerializer' threw an exception..

dhruvgohiloo7 avatar Jun 15 '21 07:06 dhruvgohiloo7

see here:

https://github.com/IdentityModel/IdentityModel.OidcClient/issues/292

leastprivilege avatar Jun 15 '21 11:06 leastprivilege

@leastprivilege I went through the link you provided and tried migrating nuget management format to PackageReference but after migrating to PackageReference, I started getting lots of other errors.

dhruvgohiloo7 avatar Jun 16 '21 09:06 dhruvgohiloo7

Well - yes - it sucks ;)

If you read through the thread you can see this is a Microsoft package mismatch issue - I am surprised it has not been fixed yet.

I fixed this sample:

https://github.com/IdentityModel/IdentityModel.OidcClient.Samples/blob/main/iOS_AuthenticationServices/iOS11Client/iOS11Client.csproj

leastprivilege avatar Jun 16 '21 10:06 leastprivilege

@leastprivilege I have started getting xamarin package issues so I have downgraded the identitymodel version for now. Will this issue resolved in the next identitymodel release or I must have to migrate to PackageReference for iOS?

dhruvgohiloo7 avatar Jun 24 '21 05:06 dhruvgohiloo7

It is not an IdentityModel issue. It's a Microsoft issue as you can see from the referenced thread. It's out of my control.

leastprivilege avatar Jun 24 '21 05:06 leastprivilege