jamescourtney / FlatSharp

Fast, idiomatic C# implementation of Flatbuffers
Apache License 2.0
510 stars 51 forks source link

Assembly reference errors on Unity 2021 #244

Closed yewnyx closed 2 years ago

yewnyx commented 3 years ago

There seem to be issues in Unity 2021.2 relating to System.Memory APIs in Unity, since it would seem to have some unholy union of .NET profiles to get Span<> functionality that it would otherwise have to wait a long time for from .NET Core: https://forum.unity.com/threads/2021-2-0b6-and-system-memory-readonlyspan-under-net-4-8.1152104/page-2

If my read is correct, an appropriate fix might be to include a binary built against netstandard2.1?

The linked thread refers to errors with protobufs and spans, so I would presume the class of errors are similar due to the shared history of protobufs and flatbuffers.

yewnyx commented 3 years ago

I've verified that a netstandard2.1 build does in fact fix the issues, it would be nice for the csproj's to be updated to add support.

jamescourtney commented 3 years ago

Hey -- thanks for opening this (and fixing it!).

Do you just need FlatSharp.Runtime to add netstandard2.1?

yewnyx commented 3 years ago

That appeared to be sufficient, though I can't say I've exhaustively tested it. We're sticking to Flat# 4.2.2, but were trying something small on 2021 and 6.0.0 and fixed it by building against 2.1.

jamescourtney commented 2 years ago

I've fixed this in #248. 6.0.1 will be published later today.