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


The following steps use the Xamarin.Forms PCL template as an example, but the same general method will also work for the Xamarin.Forms Shared Project template.

  1. Copy the original template .zip from:

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Xamarin\Xamarin\3.1.228.0\T\PT\Mobile Apps

  2. Unzip the .zip to a temporary location.

  3. Change all of the occurrences of "1.0.6186" in all of the .vstemplate files with the new version you'd like to use. For example: "1.2.2.6243".

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

    <Name>Blank App (Xamarin.Forms Portable) - 1.2.2.6243</Name>
  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/1.2.2.6243 (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 12.0\Common7\IDE\Extensions\Xamarin\Xamarin\3.1.228.0\Packages

Last Updated: Oct 31, 2016 04:53PM EDT