MonoAndroid System.ObjectModel not recognized by Visual Studio 2015?

I recently installed the Xamarin platform and I created the Xamarin.Forms Shared project using VS2015, and in the Droid References project I get a yellowish icon in the System.ObjectModel library, as you can see ... System.ObjectModel

The strange thing is that at the beginning everything compiles, but when I add Cross-Platform -> Forms Xaml Page , the compiler throws an error when calling the InitializeComponent() method. Error calling InitializeComponent () method

I tried to manually reference System.ObjectModel.dll to the path C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades with no luck. When I right click on the properties, I get this Visual Studio 2015 System.ObjectModel Properties

but in the file system properties everything seems to be correct. System.ObjectModel.dll Properties

All of the above contains default options.

Does this happen to you or to you? (I tested it on two computers)

If you have any questions, I will update the post after this post ...

+7
dll visual-studio-2015 xamarin.android xamarin.forms object-model
source share
4 answers

Welcome to Xamarin! It is like dancing your way through a landmine field. But XAML is awesome. Here's what worked for me: refresh your xamarin forms nuget, do a clean assembly, see an error / warning message, restart a visual studio, do a clean reload the visual studio again, do the assembly, rotate your chair about 3 times counterclockwise , and voila, the error has disappeared. It is like magic! No need to manually work a lot with the dll, it just works.

+17
source share

Try deleting the contents of the bin folder in the PCL project and Android project. and clear the solution, try again.

link: http://xamarin103.rssing.com/browser.php?indx=50717177&item=8379 user: PubuduGayan, the second option he proposed.

+1
source share

I had the same problem. Adding a link from C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5.2 \ Facades ... did not work. For me the change (Tools / Options / Project and Solutions-> Build and Run) of verbosity from normal to minimal worked, even if system-warning-system.objectmodel still exists.

Perhaps this will work for developers who are facing the same problem.

0
source share

I ran into the same problem. Removing the link helped resolve the warning since System.ObjectModel was not used at all.

0
source share

All Articles