I am using Twilio Conversation and generating JWT for token.
When calling new Twilio.Jwt.AccessToken(/*parameters*/).ToJwt()
method, it causes
'token.ToJwt()' threw an exception of type 'System.ArgumentException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2147024809
HelpLink: null
InnerException: null
Message: "An item with the same key has already been added. Key: cty"
ParamName: null
Source: "System.Private.CoreLib"
StackTrace: " at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)\r\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\r\n at Twilio.Jwt.BaseJwt.ToJwt()"
TargetSite: {Void ThrowAddingDuplicateWithKeyArgumentException[T](T)}
Why this causes?