Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'Xamarin.Forms.Preserve Attribute' from assembly 'Xamarin.Forms.Core'

I've just inherited an old Xamarin Forms application and I'm trying to upgrade all the packages. App was initially running fine, but since upgrading to the latest version of all packages, I'm now getting a crash calling Xamarin.Forms.Forms.Init(this, bundle);:

Could not load type 'Xamarin.Forms.PreserveAttribute' from assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.

Here's my packages.config file contents:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="ExifLib.PCL" version="1.0.1" targetFramework="MonoAndroid50" />
  <package id="Microsoft.Bcl" version="1.1.10" targetFramework="MonoAndroid50" />
  <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="MonoAndroid50" />
  <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="MonoAndroid50" />
  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.v7.AppCompat" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.v7.CardView" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.v7.RecyclerView" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Android.Support.Vector.Drawable" version="23.3.0" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Forms" version="2.3.0.38-pre2" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Forms.Labs" version="1.2.1-pre2" targetFramework="MonoAndroid44" />
  <package id="Xamarin.Forms.Maps" version="2.2.0.31" targetFramework="MonoAndroid50" />
  <package id="Xamarin.GooglePlayServices.Base" version="29.0.0.1" targetFramework="MonoAndroid50" />
  <package id="Xamarin.GooglePlayServices.Basement" version="29.0.0.1" targetFramework="MonoAndroid50" />
  <package id="Xamarin.GooglePlayServices.Maps" version="29.0.0.1" targetFramework="MonoAndroid50" />
  <package id="Xamarin.Insights" version="1.12.3" targetFramework="MonoAndroid50" />
</packages>
like image 707
Mick Byrne Avatar asked May 16 '16 04:05

Mick Byrne


1 Answers

I closed Xamarin Studio and cleared obj and bin folders and started Xamarin Studio again and everything worked fine

like image 179
Korayem Avatar answered Sep 28 '22 11:09

Korayem