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

4

7

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...

Nim answered 10/6, 2016 at 17:31 Comment(4)
Add reference to the respective dll which is located in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\FacadesEstriol
Not an ideal solution, but this issue goes away if you Remove the UWP project.Disc
Which windows version you are running ? All my nightmares were with Windows 7. I must add here that last week my company moved to windows 10, and all my Xamarin issues are gone. All of them. Emulator works smoothly, debugging in the device itself works perfectly. And what's more: the only thing I did, related to Xamarin, was to select the Xamarin Cross Platform component in the Visual Studio 2015 installation after my computer was formatted before installing W10.Downward
Thanks. It is W10 ProNim
J
17

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.

Jarv answered 8/8, 2016 at 19:46 Comment(4)
Thank you so much. Update-Package –reinstall Xamarin.Forms, perfect.Lanna
This is, first of all, the most accurate description of Xamarin development, congratulations. I am astonished in how this thing is a complete out of control mess. Lastly, thank you for pointing out to reinstalling the packages via nuget. This is the only thing that made me finally see my Xamarin Hello World form for the fist time, after a couple of days trying.Downward
I am pasting the comment I added to the question, which describes a huge turnaround: All my nightmares were with Windows 7. I must add here that last week my company moved to windows 10, and all my Xamarin issues are gone. All of them. Emulator works smoothly, debugging in the device itself works perfectly. And what's more: the only thing I did, related to Xamarin, was to select the Xamarin Cross Platform component in the Visual Studio 2015 installation after my computer was formatted before installing W10Downward
@Dpedrinha I'm glad that worked! I have had this error return sporadically. I hope this all just magically goes away with VS2017...Jarv
P
1

Try to delete the contain of bin folder in PCL project and android project. and clean the solution try it again.

reference: http://xamarin103.rssing.com/browser.php?indx=50717177&item=8379 user: PubuduGayan, The second option that He suggested.

Permalloy answered 14/11, 2016 at 18:49 Comment(0)
S
0

I hade same problem. Adding reference from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades... didn't work me. What worked for me was to change (Tools/Options/Project and Solutions->Build and Run) Verbosity from normal to minimal, even if system.objectmodel reference-warning is still there.

Maybe this will work for developers too who are facing same problem

Salem answered 22/9, 2016 at 15:6 Comment(0)
S
0

I faced the same problem. Deleting the reference helped in resolving the warning since System.ObjectModel was not used at all.

Superclass answered 21/11, 2016 at 14:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.