I use Portable Class Libraries (PCL) in Xamarin Studio on OS X. I have two PCL libraries designed for .NET 4.5, Windows Phone 8, Windows Store Apps, Xamarin.iOS and Xamarin.Android. I reference these two libraries in my iOS, Android, and Unit projects. In 3 areas, I get the following error:
The type "System.Object" is defined in an assembly that is not referenced. You must add a reference to the assembly "System.Runtime, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a".
The code is simple:
MyClass myClass = new MyClass();
The error occurs once in each of the projects that reference the PCL. None of them are the same class. I am new to PCL. I tried to uninstall Windows Phone 8 (since I added it at the last minute), but the problem persists. Any help would be called!
Thanks!
Update:
So this happens with the first field declared in the class (where is the class from the PCL project).
int a = 0; MyPCLClass _myPCLClass = new MyPCLClass();
Another unusual aspect is that with these classes there are more than 50 classes, and the error appears in only three classes.
source share