Error Using DataContractSerializer

I am getting this error when trying to create a DataContractSerializer in my Unity script.

TypeLoadException: Could not load type
from assembly
Version=, Culture=neutral,
(System.Type type, IEnumerable1 knownTypes, Int32 maxItemsInObjectGraph, Boolean ignoreExtensionDataObject, Boolean preserveObjectReferences, IDataContractSurrogate dataContractSurrogate) System.Runtime.Serialization.DataContractSerializer..ctor (System.Type type, IEnumerable1
(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.


Apparently its a pro only feature, to use external DLL.s in your scripts.