Skip to content

why Newtonsoft.Json too big when build native aot  #88600

Closed

Description

@NCLnclNCL

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

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jul 10, 2023
  2. hez2010 commented on Jul 10, 2023

    @hez2010
    Contributor

    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.

  3. locked and limited conversation to collaborators on Jul 10, 2023
  4. converted this issue into a discussion #88601 on Jul 10, 2023
  5. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions