Jeff Nama
Jeff Nama

Reputation: 61

New Xamarin project doesn't use the newest Xamarin version

I'm new to Xamarin. I installed it through Visual Studio Installer ( I'm using Visual Studio 2017 ). I noticed that when I create a new blank project, the version of Xamarin.Forms is 3.4.0.(...), which is quite an older version. I read that Xamarin.Forms version is bound to the Visual Studio version, but the weird thing, and the reason why I made this thread, is that while working on my first tutorial project, VS prompted me to upgrade my Xamarin independently. This upgraded the Xamarin.Forms to 4.4.0.(...), but only for this Project. Newly created projects still have X.F 3.4.0.(...) and also, they don't prompt me to upgrade. Furthermore, the upgraded project crashes on navigating between pages with following exception.

System.TypeLoadException: Could not resolve type with token 0100003a from typeref (expected class 'Xamarin.Forms.NavigableElement' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null')

I can't find any information about Xamarin.Forms higher than 3.4.0 being incompatible with VS17, but it would make sense considering the exception ( same source code works fine when ran on 3.4.0 ). But if that's the case, why did I get prompted to upgrade Forms? I already reinstalled Xamarin and that didn't change anything.

Upvotes: 0

Views: 903

Answers (1)

ottermatic
ottermatic

Reputation: 1012

Xamarin.Forms is not bound to visual studio at all. I believe that the Xamarin.Android and Xamarin.iOS versions are bound to visual studio, but Xamarin.Forms is simply a nuget package that you update.

  1. Right click on the solution in the Solution Explorer.
  2. Select "Manage Nuget Packages for Solution".
  3. Click the "Update" tab at the top.
  4. Click the checkbox next to Xamarin.Forms.
  5. Click "Update".

Or, alternatively, just click "Update All".

The reason you're seeing the project created with an older version of Xamarin.Forms is because the template used to create the project is old and is unaware of newer versions of Xamarin.Forms.

Upvotes: 3

Related Questions