Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MonoAndroid's System.ObjectModel is not recognized by Visual Studio 2015?

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

The weird thing is that in the beginning everything compiles but when i add a Cross-Platform -> Forms Xaml Page the compiler throws error on the InitializeComponent() method call. InitializeComponent() method call error

I tried to manually reference System.ObjectModel.dll from the path C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades without any 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 the above are with the default options.

Does this happen to you or it's just me? (i tested it in two computers)

If you have any questions i will update the post after this message...

like image 510
CodeArtist Avatar asked Jun 10 '16 17:06

CodeArtist


1 Answers

Welcome to Xamarin! It's like tap dancing your way through a field of land mines. But XAML is awesome. Here is what worked for me: update your nuget of xamarin forms, do clean build, see the error/warning, restart visual studio, do a clean, restart visual studio again, do a build, spin your chair around 3 times counter-clockwise, and voila, the error is gone. It's like magic! No need to manually much around with dlls, it will just work.

like image 117
Jason Avatar answered Oct 03 '22 07:10

Jason