Description
What version of gRPC and what language are you using?
grpc_unity_package.2.27.0-dev
C#
What operating system (Linux, Windows,...) and version?
Windows 10 2004
What runtime / compiler are you using (e.g. python version or version of gcc)
Unity 2019.3.0f6
What did you do?
I downloaded the last unity package (2.27.0) from https://packages.grpc.io/, extracted it to the Asset/Plugins folder.
What did you expect to see?
The plugin to work.
What did you see instead?
The Google.Protobuf dll failed to load with the following messages:
Error: Could not load signature of Google.Protobuf.ByteString:get_Span due to: Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type:<unknown type> member:(null) signature:<none>
Unloading broken assembly Assets/Plugins/Google.Protobuf/lib/net45/Google.Protobuf.dll, this assembly can cause crashes in the runtime
It appears that Google.Protobuf.dll has an assembly reference to version 4.0.1.0 (4.5.2)of System.Memory, but Grpc.Core has a reference to version 4.0.1.1 (4.5.3), and that's the version that is included in the unity package, so the version used by Protobuf is missing.
Anything else we should know about your project / environment?
I tried upgrading the reference in the Google.Protobuf project to 4.0.1.1 in Visual Studio, but it gave the following error:
Severity Code Description Project File Line Suppression State
Error NU1202 Package System.Memory 4.5.3 is not compatible with netstandard1.0 (.NETStandard,Version=v1.0). Package System.Memory 4.5.3 supports:
- netcoreapp2.1 (.NETCoreApp,Version=v2.1)
- netstandard1.1 (.NETStandard,Version=v1.1)
- netstandard2.0 (.NETStandard,Version=v2.0) Google.Protobuf <removed>\code\protobuf\csharp\src\Google.Protobuf\Google.Protobuf.csproj 1
Downgrading the version used by Grpc seemed to work locally, but that seems less than desirable. Unity doesn't seem to support loading multiple versions of the same dll or bindingRedirects.