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

Is Json.NET Supporting .NET 7 AOT? #2732

Open
AloisKraus opened this issue Sep 11, 2022 · 6 comments
Open

Is Json.NET Supporting .NET 7 AOT? #2732

AloisKraus opened this issue Sep 11, 2022 · 6 comments

Comments

@AloisKraus
Copy link

Stephen Toub has mentioned in https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/comment-page-3/#native-aot

that if you publish a .NET 7 application with AOT support no JIT compiler exists. Is Json.NET able to work around that like System.Text.Json which has since .NET 6.0 compile time source generator support? I would love to continue to use Json.NET because it I still want to target .NET 4.8.

@JamesNK
Copy link
Owner

JamesNK commented Sep 11, 2022

Unlikely. It wasn’t designed for AOT and adding something like a generator would be a huge amount of work.

@owl-guy
Copy link

owl-guy commented Nov 17, 2022

@JamesNK So what now? Will there be a compatible version or should I look for a different Json Package? I'm not able to publish my app on iOS unless I have it use the interpreter.

@g0dpain
Copy link

g0dpain commented Nov 22, 2022

@JamesNK So what now? Will there be a compatible version or should I look for a different Json Package? I'm not able to publish my app on iOS unless I have it use the interpreter.

use System.Text.Json

@NCLnclNCL
Copy link

Không thể. Nó không được thiết kế cho AOT và việc thêm một thứ gì đó như máy phát điện sẽ là một khối lượng công việc khổng lồ.

why??

@madelson
Copy link

madelson commented Jan 6, 2024

adding something like a generator would be a huge amount of work

Would just falling back to reflection in the AOT scenario be a more feasible step forward? My guess is that reflection is plenty fast enough for most users.

@BMurri
Copy link

BMurri commented Apr 8, 2024

@madelson

Would just falling back to reflection in the AOT scenario be a more feasible step forward? My guess is that reflection is plenty fast enough for most users.

AOT includes trimming, which strips away a lot of reflection metadata. Source generation is basically a requirement for the AOT scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants