0
votes

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.

1
VS 2019 had released , so you could firstly update the IDE to the latest version (16.4.x)Lucas Zhang
@LucasZhang-MSFT It's on a work computer. Due to unrelated reasons, I'm bound to use VS17 ( everybody else uses 15, so I'm pushing it a bit already ). They're using some outdated software, e.g. for version control, with workarounds. Those would've to be remade for 19. In my defence, I use 19 on my personal computer :)Jeff Nama
You could open the nuget manage and update the version of XF.Lucas Zhang

1 Answers

3
votes

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.