Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deserialize JSON #57232

Open
vsfeedback opened this issue Aug 11, 2021 · 4 comments
Open

Unable to deserialize JSON #57232

vsfeedback opened this issue Aug 11, 2021 · 4 comments
Labels
area-Codegen-AOT-mono needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-ios Apple iOS
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


I'm referencing System.Text.Json NuGet package version 5.0.2. I'm not able to deserialize valid JSON file. The method JsonSerializer.Deserialize(string json, JsonSerializerOptions? options = null) throws following exception:

System.ExecutionEngineException: 'Attempting to JIT compile method 'int System.Text.Json.JsonWriterHelper:NeedsEscaping (System.ReadOnlySpan`1<byte>,System.Text.Encodings.Web.JavaScriptEncoder)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

at System.Text.Json.JsonEncodedText.EncodeHelper (System.ReadOnlySpan`1[T] utf8Value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00000] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.TranscodeAndEncode (System.ReadOnlySpan`1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00033] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.Encode (System.ReadOnlySpan`1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.Encode (System.String value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonSerializer.. cctor () [0x00042] in <cb68364b029e41c3bf425990b94c94d9>:0 

Original Comments

Feedback Bot on 7/1/2021, 01:35 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Václav Dajbych on 7/8/2021, 01:38 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels Aug 11, 2021
@ghost
Copy link

ghost commented Aug 11, 2021

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

This issue has been moved from a ticket on Developer Community.


I'm referencing System.Text.Json NuGet package version 5.0.2. I'm not able to deserialize valid JSON file. The method JsonSerializer.Deserialize(string json, JsonSerializerOptions? options = null) throws following exception:

System.ExecutionEngineException: 'Attempting to JIT compile method 'int System.Text.Json.JsonWriterHelper:NeedsEscaping (System.ReadOnlySpan`1<byte>,System.Text.Encodings.Web.JavaScriptEncoder)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

at System.Text.Json.JsonEncodedText.EncodeHelper (System.ReadOnlySpan`1[T] utf8Value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00000] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.TranscodeAndEncode (System.ReadOnlySpan`1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00033] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.Encode (System.ReadOnlySpan`1[T] value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonEncodedText.Encode (System.String value, System.Text.Encodings.Web.JavaScriptEncoder encoder) [0x00014] in <cb68364b029e41c3bf425990b94c94d9>:0 
  at System.Text.Json.JsonSerializer.. cctor () [0x00042] in <cb68364b029e41c3bf425990b94c94d9>:0 

Original Comments

Feedback Bot on 7/1/2021, 01:35 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Václav Dajbych on 7/8/2021, 01:38 PM:

(private comment, text removed)


Original Solutions

(no solutions)

Author: vsfeedback
Assignees: -
Labels:

area-System.Text.Json, untriaged

Milestone: -

@danmoseley
Copy link
Member

#56533
#47114
#55503

seems it's fixed -- perhaps there is a workaround we can share with this customer?

@eiriktsarpalis
Copy link
Member

cc @MaximLipnin

@eiriktsarpalis eiriktsarpalis self-assigned this Aug 12, 2021
@eiriktsarpalis eiriktsarpalis added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Aug 13, 2021
@eiriktsarpalis eiriktsarpalis added this to the 7.0.0 milestone Aug 14, 2021
@dajbych
Copy link

dajbych commented Aug 23, 2021

@danmoseley I have updated Visual Studio 2019 to version 16.11.1 and Xamarin.iOS SDK to version 14.20.0.25. This error remains.

@steveisok steveisok modified the milestones: 7.0.0, 8.0.0 Aug 5, 2022
@steveisok steveisok modified the milestones: 8.0.0, Future Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Codegen-AOT-mono needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-ios Apple iOS
Projects
None yet
Development

No branches or pull requests

5 participants