2014-11-17 5 views
1

나는 푸른 색 방울 저장소에서 이미지 목록을 가져 오는 예외 목록을 얻기 위해 Microsoft.WindowsAzure.StorageClient을 사용하고 있습니다. "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host". 이 예외를 어떻게 해결할 수 있습니까?azure blob storage- 전송 연결에서 데이터를 읽을 수 없습니다. 원격 호스트에서 기존 연결을 강제로 닫았습니다.

내 코드 :

 var azureBlobStorageConnectionString = ConfigurationManager.AppSettings["AzureBlobStorageConnectionString"]; 

     var azureBlobContainerName = ConfigurationManager.AppSettings["AzureBlobContainerName"]; 

     // Retrieve storage account from connection string. 
     CloudStorageAccount storageAccount = CloudStorageAccount.Parse(azureBlobStorageConnectionString); 

     // Create the blob client. 
     CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); 

     // Retrieve reference to a previously created container. 

     CloudBlobContainer container = blobClient.GetContainerReference(azureBlobContainerName); 

     // Loop over items within the container and output the length and URI. 
     var containerList = container.ListBlobs().ToList(); 

     ImagesUrls = new List<string>(); 

     foreach (var item in containerList) 
     { 
      var blob = (CloudBlockBlob)item; 
      ImagesUrls.Add(blob.Uri.AbsolutePath); 
     } 
+0

왜 이런 이유로 작동하지? 나는 container.ListBlobs()에서 오류를 표시하는 매우 유사한 문제를 경험하고있다. 또한 컨테이너에 10K 이상의 얼룩이 생깁니다. – SammyG

답변

0

나는 서비스에서 모든 데이터를 얻기 전에, 그것을 확인 닫는 것 동안 루프가 올바르게 작동하지 않을 생각합니다.

+1

여기에 오류가 발생했습니다 : "var containerList = container.ListBlobs(). ToList();" –

+1

또한 동일한 문제에 직면합니다 – user145610

+1

나는 또한이 문제에 직면하고 있습니다. –

관련 문제