Can I update the Xamarin.Forms default template to a newer NuGet package?

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

This guide uses the Xamarin.Forms PCL template as an example, but the same general method will also work for the Xamarin.Forms Shared Project template. This guide is written with the example of updating from Xamarin.Forms 1.5.1.6471 to 2.1.0.6529, but the same steps are possible to set other versions as the default instead.

  1. Copy the original template .zip from:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\[Xamarin Version]\T\PT\Cross-Platform\Xamarin.Forms.PCL.zip

  2. Unzip the .zip to a temporary location.

  3. Change all of the occurrences of the old version of the Forms package to the new version you'd like to use.

    • FormsTemplate\FormsTemplate.vstemplate
    • FormsTemplate.Android\FormsTemplate.Android.vstemplate
    • FormsTemplate.WinPhone\FormsTemplate.WinPhone.vstemplate
    • FormsTemplate.iOS\FormsTemplate.iOS.vstemplate

    Example: <package id="Xamarin.Forms" version="1.5.1.6471" /> -> <package id="Xamarin.Forms" version="2.1.0.6529" />

  4. Change the "name" element of the main multi-project template file (Xamarin.Forms.PCL.vstemplate) to make it unique. For example:

    Blank App (Xamarin.Forms Portable) - 2.1.0.6529

  5. Re-zip the whole template folder. Make sure to match the original file structure of the .zip file. The Xamarin.Forms.PCL.vstemplate file should be at the top of the .zip file, not within any folders.

  6. Create a "Mobile Apps" subdirectory in your per-user Visual Studio templates folder:

    %USERPROFILE%\Documents\Visual Studio 2013\Templates\ProjectTemplates\Visual C#\Mobile Apps

  7. Copy the new zipped-up template folder into the new "Mobile Apps" directory.

  8. Download the NuGet package that matches the version from step 3. For example, http://nuget.org/api/v2/package/Xamarin.Forms/2.1.0.6529 (see also http://stackoverflow.com/questions/8597375/how-to-get-the-url-of-a-nupkg-file), and copy it into the appropriate subfolder of the Xamarin Visual Studio extensions folder:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\[Xamarin Version]\Packages

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.