Closed NCLnclNCL closed 5 months ago
I believe that (with apologies if my knowledge of newtonsoft.json is not up to date: There are aspects of this library that are compatible with nativeaot (e.g. using JsonObject constructors etc. to serialize and deserialize). There are also aspects that are not compatible (e.g. taking a dotnet class and using reflection to serialize and deserialize it).
This library then would need to be annotated for trimming. E.g. DynamicallyAccessedCode annotations on Serialize<'T>. Then consumers of the library will not see warnings unless they use the problematic code.
Although system.text.json is compatible with json, it seems that very few projects use it because it is unfamiliar and only available for dotnet core a lot of projects use this but because this is not trimmed it has a lot more size compared to the newer library i wish someone can make it compatible with native aot, or show me how to reduce the compile size with this library