Utf8Json icon indicating copy to clipboard operation
Utf8Json copied to clipboard

Is this supposed to compile with net standard 2.0?

Open sebas77 opened this issue 5 years ago • 5 comments

It seems that the code is not net standard 2.0 compatible.

sebas77 avatar Aug 14 '19 10:08 sebas77

Why do you think that? https://github.com/neuecc/Utf8Json/blob/608cf01589cb3feb225a6e51a2324a24466fdaa6/src/Utf8Json/Utf8Json.csproj#L3

Tornhoof avatar Aug 24 '19 13:08 Tornhoof

I'm trying to build it with Unity .net 2.0 compat and it fails for several reasons. Using the unitypackage with Unity 2019.3.

I don't have time to fix them all, but I'll tell you what I know in case someone else has the ambition to address this issue.

  1. some safe methods are erroneously marked unsafe like AutomataDictionary.Add
  2. various unsafe methods are defined outside any #if such as AutomataDictionary GetKey (should be #if guarded to choose only GetKeySafe) *note this whole pattern is generally bad - the safe/unsafe method name should be the same so callers don't have to #if on every call site.
  3. it looks like there was something trying to work with the commented out GetKeySafeMethod, but no code uses the safe version
  4. idk how the shims are suppose to work, but you can't mix a shim'ed type like TypeInfo from Reflection.cs with a real TypeInfo from mscorlib, things like IsNullable calls fail because of the miss-match.

I'm sure there is more, but I gave up at this time since my 'let me quickly drop in a fast json parser' turned into a major effort.

brandf avatar Feb 17 '20 17:02 brandf

Also, I tried opening the unity project, but the unity simlink batch seems broken too. it made files for various directories.

brandf avatar Feb 17 '20 17:02 brandf

Final bit of info, the unitypackage should ideally have an asmdef file included. I got a whole bunch of additional issue when I tried to include one myself, but without this nobody can use this package with UPM.

brandf avatar Feb 17 '20 17:02 brandf

This does not seem usable for me either for Unity. I dont like things that dont compile.

TinyTeaTree avatar Oct 25 '21 09:10 TinyTeaTree