title: How to use System.IdentityModel.Tokens.Jwt 5.2.1 in .NET 3.5?
body: <p>I have project where i want to validate the token from the request. My project's .NETFramework version is <strong>3.5</strong>. I am trying to use the below code in my project and these piece of code, i have used in an another project to validate a token where the .NETFramework version is <strong>4.5.2</strong>.</p>
  
  <pre><code>using Microsoft.IdentityModel.Tokens;
  using System;
  using System.Collections.Generic;
  using System.IdentityModel.Tokens.Jwt;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace TokenValidator
  {
      public class TokenValidator
      {
          public static bool IsTokenValid(string token, string secretKey)
          {
              string tokenPGID;
              JwtSecurityToken validatedToken;
  
              try
              {
                  validatedToken = ValidateToken(token, secretKey) as JwtSecurityToken;
  
                  return true;
              }
              catch (Exception)
              {
                  return false;
              }
          }
  
          private static SecurityToken ValidateToken(string token, string secretKey)
          {
              var handler = new JwtSecurityTokenHandler();
              var tokenS = handler.ReadToken(token) as JwtSecurityToken;
              TokenValidationParameters tokenValidationParameters = new TokenValidationParameters
              {
                  IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)),
                  RequireExpirationTime = true,
                  ValidateLifetime = true,
                  ValidateAudience = false,
                  ValidateActor = false,
                  ValidateIssuer = false
              };
              SecurityToken securityToken = new JwtSecurityToken();
              handler.ValidateToken(token, tokenValidationParameters, out securityToken);
  
              return securityToken;
          }
      }
  }
  </code></pre>
  
  <p>But, i am getting below error in my project:</p>
  
  <blockquote>
    <p>Error     Could not install package 'System.IdentityModel.Tokens.Jwt
    5.2.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5', but the package does not contain
    any assembly references or content files that are compatible with that
    framework. For more information, contact the package author.</p>
  </blockquote>
  
  <p>Is there any way to validate JWT token in a project of .NETFramework 3.5 means which version of this package should i use to be compatible with .NET 3.5?</p>
  
  <p>Is there any other way to validate a JWT token in .NET 3.5?</p>