azure-sdk-for-net: [BUG] System.MissingMethodException: Method not found: System.ReadOnlyMemory`1 Azure.Storage.UploadTransferValidationOptions.get_PrecalculatedChecksum() when trying to upload file

Library name and version

Azure.Storage.Blobs 12.14.1

Describe the bug

When trying to upload a simple file using await container.GetBlobClient(file).UploadAsync(Path.Combine(Constants.FileStoragePath, file)) under Xamarin.Forms 5 targeting .NET Standard 2.1 a MissingMethodException is thrown with this stack trace:

Error during sync: "System.MissingMethodException: Method not found: System.ReadOnlyMemory`1<byte> Azure.Storage.UploadTransferValidationOptions.get_PrecalculatedChecksum()
  at Azure.Storage.Blobs.Specialized.BlockBlobClient.GetPartitionedUploader (Azure.Storage.StorageTransferOptions transferOptions, Azure.Storage.UploadTransferValidationOptions validationOptions, System.Buffers.ArrayPool`1[T] arrayPool, System.String operationName) [0x00006] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.GetPartitionedUploader (Azure.Storage.StorageTransferOptions transferOptions, Azure.Storage.UploadTransferValidationOptions validationOptions, System.Buffers.ArrayPool`1[T] arrayPool, System.String operationName) [0x00006] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.StagedUploadInternal (System.IO.Stream content, Azure.Storage.Blobs.Models.BlobUploadOptions options, Sys
tem.Boolean async, System.Threading.CancellationToken cancellationToken) [0x00194] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.UploadAsync (System.String path, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders, System.Collections.Generic.IDictionary`2[TKey,TValue] metadata, Azure.Storage.Blobs.Models.BlobRequestConditions conditions, System.IProgress`1[T] progressHandler, System.Nullable`1[T] accessTier, Azure.Storage.StorageTransferOptions transferOptions, System.Threading.CancellationToken cancellationToken) [0x000e0] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.UploadAsync (System.String path, System.Boolean overwrite, System.Threading.CancellationToken cancellationToken) [0x000bb] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.UploadAsync (System.String path, System.Threading.CancellationToken cancellationToken) [0x00079] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at Azure.Storage.Blobs.BlobClient.UploadAsy
nc (System.String path) [0x00077] in <7f170a8e252647f1bcb807347ee9b683>:0 
  at NegamiApp.Services.Storage.DatabaseSynchronizationService.SyncFilesAsync () [0x007be] in C:\Users\...\DatabaseSynchronizationService.cs:213 
  at NegamiApp.Services.Storage.DatabaseSynchronizationService.SyncAsync () [0x0015b] in C:\Users\...\DatabaseSynchronizationService.cs:132"

Downloading files from the container is working fine. I think the upload worked with with version 12.10.0

Expected behavior

The file is uploaded without any exceptions.

Actual behavior

The above mentioned exception is thrown and the file is not uploaded.

Reproduction Steps

Try to upload a file using

await container.GetBlobClient(file).UploadAsync(Path.Combine(Constants.FileStoragePath, file))

in the environment described below.

Environment

Microsoft Visual Studio Professional 2022 Version 17.3.5 VisualStudio.17.Release/17.3.5+32922.545 Microsoft .NET Framework Version 4.8.09032

Xamarin.Forms 5.0.0.2515 targeting .NET Standard 2.1 (C# lang version 8.0) Tested on iPad Mini Simulator & iPad Pro physical device

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

@mlxyz Apologies for the late reply. Thanks for getting back. I am discussing this issue internally. I will update this thread once I have more details.

Hi @navba-MSFT, I can now confirm that this issue is happening on iOS, but not on Windows /unresolve I’ve created an MRE project here: https://github.com/mlxyz/32474-blob-storage-ios-repro I’ve tested this exact project on an iPad Pro (6th Generation) simulator with ipadOS 16.1 and it consistently fails with the exception I described above: grafik

Thanks for looking into this @navba-MSFT. I’ve just tried running your code in a unit test project (targeting .NET Core 3.1) and it worked as expected. Maybe the issue also has something to do with the iOS platform? I will try out more next week!