screamingworld
screamingworld

Reputation: 103

MVVM Light Xamarin Refernce Error in VS 2015 (Android Project)

I always getting an error in vs 2015 when I am using mvvmlight with an android project. Every time reference to any mvvmlight object occurs the error. I can run the application, but vs marks this as an error. The error says: 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. The error occurs in the sample mvvm light flower project too.

Upvotes: 0

Views: 170

Answers (2)

yams
yams

Reputation: 952

You will need to open your projects .csproj file and add the reference's. Its a bug with Xamarin.

Example...

<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Runtime" />
<Reference Include="System.Globalization" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Net.Primitives" />

Upvotes: 1

Denis Voituron
Denis Voituron

Reputation: 298

You need to add a reference to System.Runtime (and maybe also System.Core), like a classic Assembly Reference. These references are not default included in Xamarin Droid Projects, but are used by MVVM Light.

Upvotes: 1

Related Questions