Repository navigation
|
if i build with System.Text.Json it is 6 mb but it i build with Newtonsoft.Json it is 16 mb, both have the same same size of dll files |
Answered by
hez2010
Jul 10, 2023
Replies: 2 comments 3 replies
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue Detailsif i build with System.Text.Json it is 6 mb but it i build with Newtonsoft.Json it is 16 mb, both have the same size of dll files
|
0 replies
|
Newtonsoft.Json doesn't have NativeAOT support at all, so it instead rooting the whole assembly regardless of whether a type will be used or not. |
3 replies
Answer selected by
eiriktsarpalis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Newtonsoft.Json doesn't have NativeAOT support at all, so it instead rooting the whole assembly regardless of whether a type will be used or not.
While System.Text.Json has the support if you are using source generator, so only the necessary part of code will be kept in the binary.