MessagePack for C#とEntitiesを両方入れた時にエラーが出る

環境

エラーの内容

MessagePack for C# とEntitiesをInstallすると次のようにエラーが出ます。

スクリーンショット 2020-03-22 16.28.18.png

PrecompiledAssemblyException: Multiple precompiled assemblies with the same name System.
Runtime.CompilerServices.Unsafe.dll included for the current platform. 
Only one assembly with the same name is allowed per platform. 
Assembly paths: Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll
Assets/Scripts/MessagePack/SequenceReaderExtensions.cs(39,21): error CS0433: 
The type 'Unsafe' exists in both 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 
and 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Assets/Scripts/MessagePack/Formatters/GenericEnumFormatter`1.cs(39,107): error CS0433: The type 'Unsafe' exists in both 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

これらのエラーはSystem.Runtime.CompilerServices.Unsafeが重複して存在することに起因しているようです。

解決法

Library/PackageCache/com.unity.collections@0.7.0-preview.2/ 以下にある

  • System.Runtime.CompilerServices.Unsafe.dll
  • System.Runtime.CompilerServices.Unsafe.dll.meta

を削除します。