Provider Hosted Add-In – Could not get algorithm from X509AsymmetricSecurityKey

Problem

System.InvalidOperationException: Could not get algorithm from X509AsymmetricSecurityKey 
at Microsoft.IdentityModel.S2S.Tokens.X509AsymmetricSignatureProvider..ctor(X509AsymmetricSecurityKey x509Key)    
at Microsoft.IdentityModel.S2S.Tokens.SignatureProvider.Create(SigningCredentials signingCredentials)    
at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.Sign(String signingInput, SigningCredentials signingCredentials)   
at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.WriteTokenAsString(SecurityToken token)    
at PointShare.SharePoint.PrividerHosted.AddIn.TEST.TokenHelper.IssueToken(String sourceApplication, String issuerApplication, String sourceRealm, String targetApplication, String targetRealm, String targetApplicationHostName, Boolean trustedForDelegation, IEnumerable`1 claims, Boolean appOnly)

Solution

Downgrade httpRuntimetargetFramework to .NET 4.6

Web.config:

<system.web>
    <compilation debug="true" targetFramework="4.7.2"/>
    <httpRuntimetargetFramework="4.6.2"/>