I am getting this error when trying to create a DataContractSerializer in my Unity script.
TypeLoadException: Could not load type
‘System.Runtime.Serialization.DiagnosticUtility’
from assembly
‘System.Runtime.Serialization,
Version=3.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089’.
System.Runtime.Serialization.DataContractSerializer…ctor
(System.Type type, IEnumerable1 knownTypes, Int32 maxItemsInObjectGraph, Boolean ignoreExtensionDataObject, Boolean preserveObjectReferences, IDataContractSurrogate dataContractSurrogate) System.Runtime.Serialization.DataContractSerializer..ctor (System.Type type, IEnumerable
1
knownTypes)
System.Runtime.Serialization.DataContractSerializer…ctor
(System.Type type)
In order to even get the script to compile in the editor I had to import the System.Runtime.Serialization.dll directly into my assets. Of course, I am pretty sure that is the problem. But I am clueless as to actually make this work the correct way.
Can someone please clue me in? I am using the DataContractSerializer as my primary serialization class and would like to continue doing so.
Thanks.