The type initializer for 'System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler' threw an exception.
See original GitHub issueI am using a locally compiled version of System.IdentityModel.Tokens.Jwt.6.7.1.nupkg (not from Nuget) and I am getting the exception “The type initializer for ‘System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler’ threw an exception.” from my project when instantiating new JwtSecurityTokenHandler();
. I would like to know if there are any leads that will help me resolve the issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The type initializer for System.IdentityModel.Tokens.Jwt. ...
I fixed this issue on mine by deleting the reference for "System.IdentityModel" and only having a reference to "System.IdentityModel.Tokens.
Read more >Newtonsoft.Json Exception · Issue #1033
Message=The type initializer for 'System.IdentityModel.Tokens.Jwt.JsonExtensions' threw an exception. Source=System.IdentityModel.Tokens.Jwt StackTrace: at ...
Read more >Auth0 LoginAsync complains about newtonsoft.json dll ...
TypeInitializationException : The type initializer for 'System.IdentityModel.Tokens.Jwt.JsonExtensions' threw an exception. —> System.IO.
Read more >JwtSecurityTokenHandler Class (System.IdentityModel. ...
Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.Exception ......
Read more >Access Token validating fails with JWTSecurityTokenHandler
Exceptions caught: 'System.Text.StringBuilder'. token: 'System.IdentityModel.Tokens.Jwt.JwtSecurityToken'. Source=TokenTestApp StackTrace: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@arunswarnam - We are using friend assembly mechanism to access internal classes/methods in other IdentityModel.* assemblies. Are you using a different key to sign these assemblies? If so, that would result in a public key mismatch.
Thanks @GeoK … The handle you gave regarding Friend Assemblies helped solve the issue. The main issue was delay signing the locally built nuget package with a different key.