twilio token.tojwt()导致thropAddingDuplicateWithKeyargumentException
我正在使用Twilio对话并为令牌生成JWT。
调用新的twilio.jwt.accesstoken(/*parameters*/)。tojwt()
方法,它会导致
'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)}
原因?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
keep microsoft.graph.graph 版本是相同或以下的4.30.0.
我的情况是,之后它停止了例外。
将Microsoft.graph安装到4.31.0 上方的版本时,就会发生此错误。显然,要么 microsoft.graph.graph 或 twilio 需要修复Nuget软件包。
Keep Microsoft.Graph version is same or below 4.30.0.
My case was that It stopped throwing the exception after that.
This error happens once you install Microsoft.Graph with version above 4.31.0. Apparently either Microsoft.Graph or Twilio nuget packages need to be fixed.