docusign-esign-csharp-client: Could not load type 'System.IdentityModel.Tokens.JwtSecurityTokenHandler' from assembly 'System.IdentityModel.Tokens.Jwt

Using docusign version 3.1.1-rc.

When calling RequestJWTUserToken in a WebApi project the following error occurs:

“ClassName”: “System.TypeLoadException”, “Message”: “Could not load type ‘System.IdentityModel.Tokens.JwtSecurityTokenHandler’ from assembly ‘System.IdentityModel.Tokens.Jwt, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.”, “Data”: null, “InnerException”: null, “HelpURL”: null, “StackTraceString”: " at DocuSign.eSign.Client.ApiClient.RequestJWTUserToken(String clientId, String userId, String oauthBasePath, Byte[] privateKeyBytes, Int32 expiresInHours, List1 scopes)\r\n at Homer.Service.Helpers.Docusign.JWTAuthLogin() in C:\\Code\\homer.service\\Homer.Service\\Helpers\\Docusign.cs:line 56\r\n at Homer.Service.Controllers.DocumentsController.Test() in C:\\Code\\homer.service\\Homer.Service\\Controllers\\DocumentsController.cs:line 22\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()", “RemoteStackTraceString”: null, “RemoteStackIndex”: 0, “ExceptionMethod”: “8\nRequestJWTUserToken\nDocuSign.eSign, Version=3.1.1.0, Culture=neutral, PublicKeyToken=7fca6fcbbc219ede\nDocuSign.eSign.Client.ApiClient\nOAuthToken RequestJWTUserToken(System.String, System.String, System.String, Byte[], Int32, System.Collections.Generic.List`1[System.String])”, “HResult”: -2146233054, “Source”: “DocuSign.eSign”, “WatsonBuckets”: null, “TypeLoadClassName”: “System.IdentityModel.Tokens.JwtSecurityTokenHandler”, “TypeLoadAssemblyName”: “System.IdentityModel.Tokens.Jwt, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”, “TypeLoadMessageArg”: null, “TypeLoadResourceID”: -2146233054

Am I missing something?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Was just wondering whether there’s any reason you’re only upgrading the dependency for .NET Standard and .NET Core projects? Why not upgrade it for all framework versions?

We need to stick to v5 assemblies as other libraries that we’re referencing depend on it.

Also wondering about updating for all framework versions. We have the same DocuSign and Twilio SDK incompatibility.