Search code examples
unity-game-engineairconsole

AirConsole Unity plugin gives compiler error - 'DataContractAttribute' could not be found


I'm trying to compile my AirConsole project in Monodevelop so I can debug it.

It gives a compiler error from the included 'Newtonsoft.JSON' library:

The type or namespace name `DataMemberAttribute' could not be found. Are you missing an assembly reference? (CS0246) (Assembly-CSharp)

The project builds fine running from Unity; this error only happens when you try to hit "Run" in Monodevelop, to enable the debugger.

Is there an easy way to fix this error?


Solution

  • Per the comment above: for Monodevelop, find the References folder in the root folder of your solution, right-click it, and choose Edit.

    In the window that comes up, search for System.Runtime.Serialization and add it to your references. This will let you build and debug your Unity project.