[希望这可以节省某人一些时间。]
QueueClient从已弃用的类(在 Microsoft.Azure.Storage.Queue 中)移至较新的类(在 Azure.Storage.Queues 中)时,以下代码停止工作CloudQueue:
QueueClient queue = new QueueClient(accountConnectionString, "myQueuename");
queue.Create();
queue.SendMessage(msg);
Run Code Online (Sandbox Code Playgroud)
消息正在被移动到关联的有害消息队列中,并且我在 Azure 的 ApplicationInsights 中没有看到任何错误消息。
当我手动将 Azure 存储资源管理器中的消息从有害消息队列移回队列时,它起作用了!