Reputation: 103
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
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
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