类型Microsoft.WindowsAzure.Storage.StorageException的第一次机会异常发生在Microsoft.WindowsAzure.Storage.dll中

use*_*522 5 c# azure azure-storage

我正在尝试使用队列,这是我得到的异常:

A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll

Additional information: The remote server returned an error: (400) Bad Request.
Run Code Online (Sandbox Code Playgroud)

我也检查了此问题,但找不到答案: 引发了“ Microsoft.WindowsAzure.StorageClient.StorageClientException”类型的异常

这是代码:

    storageAccount = CloudStorageAccount.Parse(
    CloudConfigurationManager.GetSetting("StorageConnectionString"));
    queueClient = storageAccount.CreateCloudQueueClient();
    rawMessageQueue = queueClient.GetQueueReference("rawMessageQueue");

    private CloudQueue rawMessageQueue;
    var QueueExists = rawMessageQueue.Exists();
Run Code Online (Sandbox Code Playgroud)

小智 1

只需更新以下 dll:

  1. Microsoft.WindowsAzure.Storage.dll

  2. Microsoft.WindowsAzure.Configuration.dll

在此输入图像描述

然后重建。