Skip to content

Instantly share code, notes, and snippets.

@brendanzagaeski
Created May 24, 2017 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendanzagaeski/5cebb11c433f3715da520b6ee1fea9ed to your computer and use it in GitHub Desktop.
Save brendanzagaeski/5cebb11c433f3715da520b6ee1fea9ed to your computer and use it in GitHub Desktop.

This is an unsupported way to run a particular Xamarin extension version manually in Visual Studio 2017 by using the Xamarin installer for Visual Studio 2015. I am recording this approach partly for my own curiosity. It worked OK for me in my own brief tests, but it is not a standard installation approach, and it has not been tested by other Xamarin team members.

CAUTION: If anyone wants to experiment with this approach, please install Visual Studio 2017 Preview alongside Visual Studio 2017, and try this approach within the Preview instance so that you can later uninstall and reset the Preview instance without affecting the primary instance.

I tested this approach in Visual Studio 2017 Preview version 15.3 (26510.0-Preview), starting with the "Mobile development with .NET" workload selected. For simplicity I deselected all of the Optional components for that workload.

  1. Download the desired Xamarin installer version for Visual Studio 2015 as described on the article about Xamarin downloads. I only tried with Xamarin.VisualStudio 4.5.0. Results might differ for other versions.

  2. Extract the contents of the .msi by running a command similar to the following in a cmd.exe command prompt. (You can change the TARGETDIR if you like.)

    msiexec /a Xamarin.VisualStudio_4.5.0.*.msi /qb TARGETDIR=C:\Temp\Xamarin
    
  3. Navigate into the Extensions directory for the Preview instance:

    %VSINSTALLDIR%\Common7\IDE\Extensions

    By default this would be one of the following locations, depending on edition:

    • C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\Common7\IDE\Extensions
    • C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\Common7\IDE\Extensions
    • C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\IDE\Extensions
  4. Delete the following directories:

    • Merq
    • Mono.Debugging
    • Xamarin.Android.Sdk
    • Xamarin.Apple.Sdk
    • Xamarin.VisualStudio
  5. Search in the Extensions directory for the file named "Xamarin.Forms.Templates.VisualStudio.pkgdef", and delete the folder that contains that file too.

  6. Move the "Xamarin" extension directory from the extracted installer:

    C:\Temp\Xamarin\VS2015_WRAPPER\Common7\IDE\Extensions\Xamarin\Xamarin

    ... into the Extensions directory from step 3.

  7. Navigate into the MSBuild directory for the Preview instance:

    %VSINSTALLDIR%\MSBuild

  8. Delete the following directories:

    • Novell
    • Xamarin
  9. Move the directories from the MSBuild directory in the extracted installer:

    • C:\Temp\Xamarin\15.0
    • C:\Temp\Xamarin\Novell
    • C:\Temp\Xamarin\Xamarin

    ... into the MSBuild directory from step 6, overwriting the one conflicting file in the 15.0 directory.

    Note: If you do not complete this step, the MSBuild Tasks will be out-of-sync with the extension, and that can cause the following error message to appear when attempting to build Xamarin.iOS projects in the IDE:

    The Xamarin Build Agent is not running on the Mac. An active Build Agent is required to perform the build.

  10. Open an elevated "Developer Command Prompt for VS 2017 Preview" and run the following 2 commands:

    • devenv /setup
    • devenv /updateconfiguration

    (This step might or might not be strictly required.)

  11. Run the following 3 VSIX installers from the extracted installer:

    • C:\Temp\Xamarin\Microsoft Shared\VisualStudio\Merq.vsix
    • C:\Temp\Xamarin\Microsoft Shared\Xamarin\Mono.Debugging.VisualStudio.vsix
    • C:\Temp\Xamarin\Microsoft Shared\Xamarin\Xamarin.Forms.vsix

    (Be sure to select only the Preview instance when running these VSIX installers.)

The installation is now complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment