Я пытался позвонить TransferManager.UploadAsync
, но продолжаю получать эту ошибку:
Method 'get_NetworkTimeout' in type 'Microsoft.Azure.Storage.File.FileRequestOptions' from assembly 'Microsoft.Azure.Storage.File, Version=11.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
Это мой метод в BaseBlobRepository.cs
:
public void Add(string name, System.IO.Stream fileStream, string contentType = null)
{
TransferManager.Configurations.ParallelOperations = 64;
SingleTransferContext context = new SingleTransferContext();
context.ProgressHandler = new Progress<TransferStatus>((progress) =>
{
Console.WriteLine("Bytes uploaded: {0}", progress.BytesTransferred);
});
var container = GetBlobContainer(_containerName);
CloudBlockBlob blockBlob = container.GetBlockBlobReference(name);
if (contentType != null)
{
blockBlob.Properties.ContentType = contentType;
}
var task = TransferManager.UploadAsync(
fileStream, blockBlob, null, context, CancellationToken.None);
task.Wait();
}