Forum Visual Studio

System.ObjectModel Missing

RadekRutkowskiRadekRutkowski CAMember
edited February 2017 in Visual Studio

I have been trying without luck to create Hello World app using Xamarin Forms, on Windows 10 using Visual Studio 15. After installing the latest and greatest and creating Blank App (Xamarin.Forms Shared) I'm getting "The referenced component System.ObjectModel could not be found" together with "The name 'InitailizeComponent' does not exist in the current context". I believe I updated all the nugets extensions, Android SDK and whatever I could find but no luck.

I tried clean, rebuild, restart, removing Resource.Designer.cs, packages and restoring, some users mentioned using .NET 4.0 instead of .NET 4.5 but can't find target .NET settings anywhere in that project

Any ideas would be welcome,

Thank you

Answers

  • ManojkumarMaliManojkumarMali USMember ✭✭✭

    Check your .xaml page property

    Build Action = Embedded Resource

  • I'm having the same issue, with Shared projects. PCL seems to work.

    I can't get anything to work in VS 2017.

    This is my second attempt at trying to use Xamarin. Bad VS templates seems to be a recurring theme with Xamarin. You guys need to spend a lot more time cleaning this mess up.

  • DomKapDomKap USMember ✭✭
    edited May 2017

    @ManojkumarMali said:
    Check your .xaml page property

    Build Action = Embedded Resource

    I have the same problem. I checked my "Build Action" and it is "Embedded Resource".
    I checked also my android references and on System.ObjectModel icon there is another icon, yellow triangular.
    What does it mean?
    I tried to install this from NuGet but didn't help.
    Any idea how to fix it?
    Thank you.

    P.S. When I start a new project then everything is fine.

  • install Xamarin.Build.Download. and update it to the latest prerelease package

    https://www.nuget.org/packages/Xamarin.Build.Download/0.4.3-beta3

    This worked for me.

  • ok after 3 days of chasing for this solution I think finally I might have the answer. I'm on vs17(of course community version). ok so its pretty simple. all you need is to decide on which level API would you like to run your application on. lets say API level 23. first make sure your android SDK path is set right by clicking on Tools>Options>Xamarin. you will see a green tick next to it. next step, go to Tools>Visual studio emulator for android. it will bring up the device profile. choose and download a device that has the same level API as you have installed in you Android SDK(in this example API 23). you can visit Android SDK by clicking Tools>Android>android manager . also remember if you have a AMD processor running your pc, install arm version otherwise x86 in you SDK. I think that's all start the device from the device profile (tools> visual studio emulator for android> once the device is on and ready. just deploy your application to that target device . I'm not having anymore trouble even though system.objectModel reference still broken, my app is running .

    if it still not deploying make sure Hyper-v is turned on. cheers.

  • disacksondisackson Member

    I know this is old but it came up at the top Google result for the "System.ObjectModel not found"
    For me the fix was to just remove the reference. In my project it was not required.

Sign In or Register to comment.