Cysharp/ZString

Unity 2021.2.0b6 breaks ZString because of System.Memory

SugoiDev opened this issue · 5 comments

Unity updated its framework and now it has System.Memory, but it is not as recent.
So it doesn't have all features, and we can no longer use System.Memory.dll because it will conflict with mscorlib.

For example, using the .NET framework profile (not .NET standard):

ZString\FormatParser.cs(34,28): error CS0570: 'ReadOnlySpan<T>.this[int].get' is not supported by the language
ZString\Shims.cs(51,32): error CS0570: 'ReadOnlySpan<T>.GetPinnableReference()' is not supported by the language

As posted in the Unity forum, I think this is a bug in Unity.

I have the same problem at Unity2021.2.0f1.
This seems to be fixed in 2021.2b16 or higher.
https://forum.unity.com/threads/2021-2-0b6-and-system-memory-readonlyspan-under-net-4-8.1152104/page-2#post-7577965

I think the actual situation is to do with the fact that unity 2021.2 natively support .net standard 2.1 API and so doesn't need the memory or buffers dlls in the unitypackage - I also think the plugin can probably be tweaked for this new environment for the better?

For now, please uncheck the box when importing.
Also, the Managed DLL is not included in the installation from UPM, so it is not a problem.

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.