Question: I do not understand the following problem I am facing.

I have 3 projects, A, B and C. All of them have a reference to `Newtonsoft.Json`, version `12.0.1`

Project a has a reference to both projects B and C. Project B, has a references to `Microsoft.IdentityModel.Tokens.Jwt`

When I run project A, I get the following runtime error when trying to execute the function necessary for creating my token.

**Message:**

> 
> "The type initializer for 'System.IdentityModel.Tokens.Jwt.JsonExtensions' threw an exception."
> 
> 
> 

**Inner Exception:**

> 
> "Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified."
> 
> 
> 

I have verified that all projects reference the same `Newtonsoft.Json` package with version `12.0.1`.
I have also checked my project files, to make sure there is no reference to `Newtonsoft.Json` version `10.0.0.0`

What am I missing?

Answer: 
I think some of your project is referring version 10, while other is referring version 12 of newtonsoft.json.dll. 

It seems the v12 DLL is getting copied to output directory. The project which refers v10 is throwing this error. 

For all the strong named assemblies, the specific version of DLL is searched in the application directory or GAC. You can overwrite this default behavior by using below configuration file entry - which instructs .net framework to always look for v12 whenever any version from 0 to 12 is called. 

```
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-12.0.1.0" newVersion="12.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

```

Hope this helps to resolve your issue.
Where you are using Microsoft.IdentityModel.Tokens.Jwt don't add it as a using to the page instead make a direct reference to it.