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?