twilio token.tojwt()导致thropAddingDuplicateWithKeyargumentException

发布于 2025-02-11 12:03:35 字数 787 浏览 0 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葮薆情 2025-02-18 12:03:35

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文