azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[QUERY] TypeLoadException while using blobclientOptions.AddPolicy on Xamarin.iOS

Open bonniemathew opened this issue 2 years ago • 1 comments

Library name and version

Azure.Storage.Blobs 12.12.0

Query/Question

Hi,

I am trying to use the Azure Blob Storage SDK to list the contents of a directory on Xamarin.iOS.

The following code fails.

            var blobClientOptions = new BlobClientOptions(BlobClientOptions.ServiceVersion.V2021_06_08);
            try
            {
                HttpPipelinePolicy policy = new AuthTokenHttpPipelinePolicy(restApiClient);
                blobClientOptions.AddPolicy(policy, HttpPipelinePosition.PerRetry);
                blobClientOptions.AddPolicy(new ApimTracingHttpPipelinePolicy(restApiClient), HttpPipelinePosition.PerRetry);
                blobClientOptions.AddPolicy(new SasTokenHttpPipelinePolicy(sasCache), HttpPipelinePosition.PerRetry);
            } catch(Exception e)
            {
                Console.WriteLine(" Caught in exception, " + e.ToString());
            }

But the line blobClientOptions.AddPolicy(policy, HttpPipelinePosition.PerRetry) fails on Xamarin.iOS. Its working fine on Xamarin.Android.

This is the exception that I am getting.

Environment

Xamarin.iOS

bonniemathew avatar Aug 10 '22 12:08 bonniemathew

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Aug 10 '22 12:08 ghost

BlobClientOptions inherits the AddPolicy method from ClientOptions from the Azure.Core package.

Adding tag for Core

Also could you define what's occurring in your custom class for AuthTokenHttpPipelinePolicy, that doesn't seem like that belongs to Azure.Core or any of our other SDKs

amnguye avatar Aug 12 '22 16:08 amnguye

FYI @jsquire

annelo-msft avatar May 18 '23 18:05 annelo-msft

Hi @bonniemathew. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar May 18 '23 18:05 github-actions[bot]

@bonniemathew: I'm unable to reproduce this with the latest VS for Mac, XCode, and Blob Storage package. As @amnguye mentioned, it would be very helpful to understand the code in your AuthTokenHttpPipelinePolicy implementation.

jsquire avatar Jun 02 '23 20:06 jsquire

Hi @bonniemathew, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar Jul 13 '23 21:07 github-actions[bot]