Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.71k forks source link

[BUG] Azure Communication Email - Xamarin forms, MAUI -iOS - System.MissingMethodException #44357

Open pasha-o opened 4 months ago

pasha-o commented 4 months ago

Library name and version

Azure.Communication.Email - 1.0.1

Describe the bug

Using this library to send an email in a Xamarin forms mobile application, for ios throws an exception, It works on android. exception: System.MissingMethodException: Method not found: int **System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncodeUtf8**(System.ReadOnlySpan1) at System.Text.Json.Utf8JsonWriter.WritePropertyName (System.ReadOnlySpan1[T] utf8PropertyName) [0x00012] in <815ff95f4d6a463fa6a3be490e0514aa>:0 at Azure.Communication.Email.EmailMessage.Azure.Core.IUtf8JsonSerializable.Write (System.Text.Json.Utf8JsonWriter writer) [0x00080] in <f62568a7c6294e4ea7d2519d80d0c734>:0 at Azure.Core.Utf8JsonWriterExtensions.WriteObjectValue (System.Text.Json.Utf8JsonWriter writer, System.Object value) [0x0014a] in <f62568a7c6294e4ea7d2519d80d0c734>:0 at Azure.Communication.Email.EmailRestClient.CreateSendRequest (Azure.Communication.Email.EmailMessage message, System.Nullable1[T] operationId) [0x000b0] in :0 at Azure.Communication.Email.EmailRestClient.SendAsync (Azure.Communication.Email.EmailMessage message, System.Nullab le1[T] operationId, System.Threading.CancellationToken cancellationToken) [0x00024] in <f62568a7c6294e4ea7d2519d80d0c734>:0 at Azure.Communication.Email.EmailClient.SendEmailInternalAsync (Azure.WaitUntil wait, Azure.Communication.Email.EmailMessage message, System.Threading.CancellationToken cancellationToken) [0x000a9] in <f62568a7c6294e4ea7d2519d80d0c734>:0 at Azure.Communication.Email.EmailClient.SendAsync (Azure.WaitUntil wait, Azure.Communication.Email.EmailMessage message, System.Threading.CancellationToken cancellationToken) [0x000c4] in <f62568a7c6294e4ea7d2519d80d0c734>:0

here is the code: var emailSendOperation = await emailClient.SendAsync(wait: WaitUntil.Completed, emailMessage); return emailSendOperation.Value.Status == EmailSendStatus.Succeeded;

Expected behavior

IT should send the email.

Actual behavior

It throws an exception.

Reproduction Steps

create an ios Xamarin app and try sending an email using the azure communication service.

Environment

No response

github-actions[bot] commented 4 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @acsdevx-msft.

pasha-o commented 4 months ago

It seems adding the latest version of System.Text.Json, resolves the issue. Perhaps an updated version of the Nuget is required?