I have a new MVC project using TokenClient from IdentityModel
var tokenClient = new TokenClient(tokenUrl, clientId, CLIENT_SECRET, null, AuthenticationStyle.BasicAuthentication);
I have the nuget package in for IdentityModel and everything compiles fine. However, at runtime I get the following error.
Method not found: 'Void IdentityModel.Client.TokenClient..ctor(System.String, System.String, System.String, System.Net.Http.HttpMessageHandler, IdentityModel.Client.AuthenticationStyle)'.
The .NET version of the MVC project is 4.6.1
What can be causing this issue? I have been searching google and cannot find anything that helps. It must be something simple that i am missing.
EDIT:
initializing it by declaring the parameters explicitly does not work either.
var tokenClient = new TokenClient(tokenUrl, clientId: clientId, clientSecret: CLIENT_SECRET);// CLIENT_SECRET, null, AuthenticationStyle.BasicAuthentication);
However initializing it with the one parameter works fine.
var tokenClient = new TokenClient(tokenUrl);