Forum Xamarin.Forms

New Project Out of the box so to speak; assembly not found System.Runtime

Created a brand new project Xamarin.Forms.Shared; Went to NuGet to update Xamarin packages; after update I get the following errors. First error shows up on Application. I can't find an assembly called System.Runtime,

Visual Studio 2015 Preview;

Any ideas?

Show Details Severity Code Description Project File Line
Error CS0012 The type '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'. CountStuff.Droid App.cs 11

public class App : Application
{
public App ()
{
// The root page of your application
MainPage = new ContentPage {
Content = new StackLayout {

Posts

  • Adam_KAdam_K CAMember

    I am also experiencing this issue, with all the error messages pointing to the file app.cs; nevertheless, each platform project will still build and deploy.

    Using Xamarin via Visual Studio 2015 Preview for close to a week now. I am not overly impressed with the quality of the platform in regards to Visual Studio.

    I am running the latest alpha release (which has resolved most issue related to deploying to iOS). :smile:

    Hopefully these issues can be address. I really like the potential of the platform and would most likely purchase a business license.

    Error   CS0012  The type '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'.   FoodMap.Droid   App.cs  10
    Error   CS0012  The type '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'.   FoodMap.iOS App.cs  10
    
    Error   CS0012  The type 'IList<>' 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'.  FoodMap.Droid   App.cs  18
    
    Error   CS0012  The type 'IList<>' 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'.  FoodMap.iOS App.cs  18
    
  • Adam_KAdam_K CAMember

    Good stuff. :smile:
    That did indeed work... I should of guessed something so simple would be the answer.
    Thanks.

  • Mobile_DanMobile_Dan USMember, Beta, University, Certified XTC Partners ✭✭

    Thank You @BradyChambers! I looked at the thread you referenced earlier and had not identified the fix I needed since it was buried among similar problems and suggestions. That thread appears to have begun as a different problem because the response marked as the answer was not the one you referenced and was not a fix I find acceptable (targeting .Net Framework 4.0 instead of 4.5).

    The fix, as you noted, was adding a reference to the dll mentioned in the error message (in my case System.Runtime.dll) from "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades" .

    This problem has kept me from using Visual Studio 2015 Community Technology Preview 6 for a while now. It manifest itself in a few ways. At one point only ReSharper was highlighting phantom errors in the text editor until the ReSharper update 9.1 fixed that issue. In the latest incarnation, I'd see about 20 errors in Visual Studio 2015's error list though the Xamarin Forms, PCL based solution would compile and run. Alas, this was too distracting for me to use Visual Studio 2015.

    The errors appeared like this...

    Error CS0012 The type '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' ... (and then a reference to a class in my Xamarin.iOS or Xamarin.Android project)

    Other instances of this error had 'Attribute', 'Type', 'Object' or 'Enum instead of 'ValueType'.

    The same solution did not show any of these phantom errors in Visual Studio 2012 and 2013.

  • wootwoot USMember

    This also helped me! I've been having issues with VS2015 and Resharper 9 just like @Mobile_Dan - it's been driving me crazy. Thanks for the solution @BradyChambers!

  • FerAntiveroFerAntivero USMember
    edited June 2015

    could reprod this in VS 2015 RC + Xamarin 3.11.586. The workaround worked for me too

  • ravensorbravensorb USMember ✭✭

    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

    Note: Importing the Facades (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facade) does help temporarily solve the issue -- however if I update an package, those are removed at the problem returns.

  • ylemsoulylemsoul RUMember ✭✭✭

    @ravensorb, what package do you update? Just add manually to the .csproj:
    <Reference Include="System.Runtime" />

  • xman10xman10 USMember ✭✭

    I am having the Same issue on my Mac, anybody help?

  • xman10xman10 USMember ✭✭

    Solved my problem by doing the following steps:
    1. double click my solution
    2. Build --> Configuration ---> Configuration Mappings
    3. ensure that Debug (Debug/iPhoneSimulator for iOS) is selected for the solution/projects.

    It works but I do not know why.

  • tofutimtofutim USUniversity ✭✭

    Is this resolved yet? I am using a 4.5 PCL with Xamarin Android and getting these intellisense errors. I feel bad linking to "Facades"

  • Vikram_BVikram_B USMember ✭✭

    Hi I am not able to reproduce the result that I would like to bring ..............

    does any one fixed the issue like in the attachment ?????????????????

Sign In or Register to comment.