gpt4 book ai didi

azure - 获取 System.InvalidOperationException : Operation is not valid due to the current state of the object while consuming Service Bus message

转载 作者:行者123 更新时间:2023-12-03 05:22:36 30 4
gpt4 key购买 nike

我在部署到环境时收到以下异常堆栈跟踪,它在我的本地工作正常:

servicebus.windows.net/poc.enterprisebus.contracts.events/updatedevent/Subscriptions/poc.Test.Worker during Receive

servicebus.windows.net/poc.enterprisebus.contracts.events/updatedevent/Subscriptions/poc.Test.Worker during Receive
[INFO] System.InvalidOperationException: Operation is not valid due to the current state of the object.
[INFO] at Microsoft.Azure.ServiceBus.Core.MessageReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan serverWaitTime)
[INFO] at Microsoft.Azure.ServiceBus.Core.MessageReceiver.<>c_DisplayClass64_0.<<ReceiveAsync>b_0>d.MoveNext()
[INFO] — End of stack trace from previous location —
[INFO] at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
[INFO] at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
[INFO] at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(Int32 maxMessageCount, TimeSpan operationTimeout)
[INFO] at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(TimeSpan operationTimeout)
[INFO] at Microsoft.Azure.ServiceBus.MessageReceivePump.<MessagePumpTaskAsync>b__11_0()

我的项目是.Net5.0,降级是我不想做的事情,除非没有选项。比如建议 here任何建议/指导将不胜感激。

提前致谢。

最佳答案

从错误详细信息来看,我认为这是由于旧服务总线包引用的 Microsoft.Azure.Amqp 版本中存在错误所致。 (详细信息可以在 #165 中找到)

添加对 Microsoft.Azure.Amqp 的直接引用项目中的包应该提升版本并解决问题。

值得注意的是Microsoft.Azure.ServiceBus该软件包已被正式弃用,不建议用于新开发。在可预见的 future ,它将继续受到支持,但将不再接收增强功能或非关键修复。

如果可能,我们建议移至 Azure.Messaging.ServiceBus .

关于azure - 获取 System.InvalidOperationException : Operation is not valid due to the current state of the object while consuming Service Bus message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71058706/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com