locked
Missing System.ObjectModel & System.Runtime assemblies RRS feed

  • Question

  • User6559 posted

    Upgrading to xcode 6 and running on the xamarin alpha with the ios8 bindings, I am now getting the below assembly errors.

    Any had anything similar / any ideas to resolve ?

    Error 21 The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    Error 20 The type 'System.ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    Error 19 The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    Tuesday, September 16, 2014 6:39 AM

Answers

  • User56068 posted

    Hi Lee.

    I finally solved this by recreating my solution from scratch, this time targeting .Net Framework 4.0 instead of .Net Framework 4.5.

    Thank you anyway for trying to help me out!

    h.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, October 14, 2014 9:27 AM

All replies

  • User56068 posted

    Hello Lee.

    Did you find a solution for this? I'm facing the same errors.

    Thank you for your answer.

    Monday, October 13, 2014 2:04 PM
  • User6559 posted

    @HeliDeCocq? a lot of re-installing and just worked, I then had another error (app crash on launch) which was resolved by ensuring "Enable generic value type sharing" was checked on the ios build advanced tab. Incase that is your issue.

    if you can share your code I can give it a run to see if works for me

    Monday, October 13, 2014 2:09 PM
  • User56068 posted

    Hi Lee.

    I finally solved this by recreating my solution from scratch, this time targeting .Net Framework 4.0 instead of .Net Framework 4.5.

    Thank you anyway for trying to help me out!

    h.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, October 14, 2014 9:27 AM
  • User6559 posted

    glad you got it sorted

    Monday, October 20, 2014 11:33 AM
  • User311 posted

    Hi, I'm having sort of the same issue, but it says with me only in Resharper as a hint (no compiler warnings or such):

    Module "System.ObjectModel ....version...." should be referenced

    Anyone else experiencing this?

    Wednesday, October 22, 2014 11:43 AM
  • User311 posted

    To get an idea

    Wednesday, October 22, 2014 2:29 PM
  • User55249 posted

    Bump. Same problem here.

    Monday, November 3, 2014 6:13 PM
  • User88648 posted

    I solved this by downloading a new System.ObjectModel.dll and then manually adding it to the package. Then when I tried to compile, I got an error that it was imported twice. So I removed the reference and then it worked. Weird.

    Thursday, November 20, 2014 11:09 PM
  • User55249 posted

    It happened again on my end after downloading the FormsGallery sample and trying to compile it. I'll try your solution Matt and see.

    Monday, December 8, 2014 1:49 PM
  • User32326 posted

    Just happened same thing with a Xamarin Forms 1.3 iOS "empty" application. I'm using 1.3.1.6294-pre1 package version, since latest 1.3 stable does not define "FormsApplicationDelegate" either!

    Message complains about missing INotifyPropertyChanged definition in referenced assemblies, but I can't find System.ObjectModel.dll among reference-able ones.

    Any hint?

    Thursday, January 1, 2015 12:31 PM
  • User27332 posted

    Add references to the respective dll (as complained by DLL) which are located in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades

    Change the .Net version to match your project settings.

    Wednesday, January 7, 2015 8:25 AM
  • User112229 posted

    I had similar problems with assembly references and it was an issue with the combination of platform targets. My Xamarin.Forms (Portable) project now targets the following:

    • .NET Framework 4.5
    • Windows 8
    • Xamarin.Android
    • Xamarin.iOS
    • Xamarin.iOS (Classic)

    The targets were originally Windows 8.1 and Silverlight. Once I removed Silverlight and bumped down to Win 8, the project was able to build without manually adding assembly references.

    Wednesday, March 11, 2015 8:55 PM
  • User112728 posted

    VS 2013 Premium Update 4 WinPhone 8.1

    For System.Runtime I can duplicate this with two steps:

    1. Add this namespace to a XAML file.

       xmlns:sys="clr-namespace:System;assembly=System.Runtime"
      
    2. Reference sys:Object. I do this by adding a resource.

       <ResourceDictionary>
            <sys:Object>This throws and file not found error.</sys:Object>
      </ResourceDictionary>
      

    As soon as I remove the resource (the namespace alone doesn't seem to cause it), it is back to working.

    Monday, May 4, 2015 4:59 AM
  • User54846 posted

    Any update to this? I am getting this all of the time for both Droid and IOS projects on Windows using VS2015 RC on Windows 8.1, Windows 10, and Server 2012 R2

    Sunday, July 12, 2015 3:17 PM
  • User19313 posted

    @ravensorb In the same boat :) And I hope, we just have to wait till tomorrow when 4.6 RC becomes 4.6 RTM with VS 2015 RTM.

    Sunday, July 19, 2015 6:21 AM
  • User1067 posted

    Unfortunately this problem does still exist with VS2015 RTM. Any ideas? For me it's the Droid project behaving this way, so reconfiguring platform targets isn't a solution.

    Wednesday, July 22, 2015 2:11 PM
  • User24142 posted

    I'm still having this issue in VS2015 RTM as well.

    Thursday, July 23, 2015 1:06 PM
  • User143614 posted

    Add references to the respective dll (as complained by DLL) which are located in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades

    Change the .Net version to match your project settings.

    This Spartan's tip solved my problem.

    Friday, July 24, 2015 7:05 PM
  • User1067 posted

    Well, this may be a solution if you're having just a handful of projects. Unfortunately we've got about 100, so adding these references by hand isn't a solution. And while we could write a script that does this, it still smells like a foul workaround. So hopefully some Xamarian comes by and tells us what's going on here...

    Monday, July 27, 2015 7:25 AM
  • User42790 posted

    I would like to see more detail explaining what "Change the .Net version to match your project settings" means because you can't change the .Net version of a Xamarin IOS project. This is driving me crazy - I have solutions that work fine with Xamarin Studio and give me this error using VS2015 pointing at the same code.

    XS is running on OS/X, VS is running under VMWare on the same machine.

    Thursday, July 30, 2015 1:07 PM
  • User1067 posted

    There's a bugreport now: https://bugzilla.xamarin.com/show_bug.cgi?id=32622

    Friday, July 31, 2015 7:21 AM
  • User80275 posted

    I had same issue and adding System.Runtime.dll (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Runtime.dll) solved the problem for me as well, but really have no idea what is going on

    I was confused since this was the first time that I created Xamarin project using VS2015, it is very strange that all important references are not included by default.

    Monday, August 3, 2015 3:03 PM
  • User1067 posted

    Well, it's a Roslyn bug. Normally you shouldn't have to add references to BCL dlls like System.Runtime. There's a better workaround now: https://bugzilla.xamarin.com/show_bug.cgi?id=32622#c4

    Tuesday, August 4, 2015 5:51 AM
  • User53115 posted

    The solution @Jefimijana posted worked for me. Add whatever references you need from

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\platform\v1.0\Facades\reference.dll

    where platform is either MonoAndroid or Xamarin.iOS.

    Friday, August 7, 2015 5:24 PM
  • User155647 posted

    Thanks Jefimija You solution worked for me as well.

    Friday, October 2, 2015 2:59 PM
  • User258150 posted

    Solved the issue like that one with: - Running (NuGet console): Update-Package -Reinstall - Reenabling the NuGet autoupdate under Tools>Options>NuGet Pckg Manager>Gerneral> Check Allow ....and Automatically ...

    Saturday, October 8, 2016 11:48 AM
  • User271417 posted

    I had the same problem when practicing an example illustrated in the MVVM example video.

    When i look at the references, it showed that the dll reference is broken.

    After trying multiple options, i cleaned the solution and boom it fixed it.

    Thursday, November 3, 2016 8:21 AM
  • User283125 posted

    @devmc said: I had similar problems with assembly references and it was an issue with the combination of platform targets. My Xamarin.Forms (Portable) project now targets the following:

    • .NET Framework 4.5
    • Windows 8
    • Xamarin.Android
    • Xamarin.iOS
    • Xamarin.iOS (Classic)

    The targets were originally Windows 8.1 and Silverlight. Once I removed Silverlight and bumped down to Win 8, the project was able to build without manually adding assembly references.

    It is working. I added missing assembly from NuGet to WinPhone project's references

    Sunday, January 15, 2017 8:25 PM
  • User275526 posted

    Ummm, I think, This problem because xamarin unstable to generate config in project.

    Tuesday, January 31, 2017 7:56 AM
  • User298885 posted

    I am having problems in System.ObjectModel.dll The system can not find a library reference. Can someone help me please?

    Friday, February 10, 2017 5:06 AM
  • User298885 posted

    @BRUNOGOMES said: I am having problems in System.ObjectModel.dll The system can not find a library reference. Can someone help me please?

    Resolved, Thank you @Spartan !

    Friday, February 10, 2017 6:16 AM
  • User275526 posted

    Thank @Jefimijana. The solution @Jefimijana posted worked for me.

    Saturday, February 18, 2017 4:34 PM
  • User312847 posted

    Bruno,

    I have the same problem, how did you solve it?

    Tuesday, March 28, 2017 10:43 PM
  • User217567 posted

    I tried @Paku's solution, then tried @Babu_A's clean the solution and it worked fine. This was a brand new project with no code.

    Thursday, August 10, 2017 3:48 PM