TypeLoadException: Could not load type 'Microsoft.IdentityModel.Json.JsonConvert' from assembly 'Microsoft.IdentityModel.Tokens, Version=7.0.3.0

Was getting this error, trying to add authentication feature into my app. Due to the assembly issues, I had to use the following assembly versions to make it work.

1st attempt

<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />

2nd attempt (more recent version of the assemblies)

 <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />

<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />

<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />

<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.1.2" />





Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm