Skip to content
  • Matt Ward's avatar
    [NuGet] Fix build error after updating Xamarin.Forms NuGet package · 3efbb988
    Matt Ward authored
    This problem was fixed in Xamarin Studio 5.8 ac846289
    and seems to have re-surfaced. On updating Xamarin.Forms in a solution
    that contains multiple projects that use it the build would sometimes
    fail with errors like:
    
        Could not load file or assembly 'Xamarin.Forms.Xaml,
        Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of
        its dependencies.
    
        Error XF002: Xamarin.Forms tasks do not match targets. Please
        ensure that all projects reference the same version of
        Xamarin.Forms, and if the error persists, please restart the IDE.
    
    The old MSBuild tasks and targets were being used after they have
    been updated. Now when an MSBuild import has changed in a project
    the remote MSBuild host is shutdown to ensure the correct tasks are
    used.
    
    Note that currently .NET Core projects are not fixed with this change
    since they have no MSBuild imports in the project.
    
    Fixes VSTS #576301 - Getting "Could not load file or assembly
    'Xamarin.Forms.Xaml" when update forms version to prerelease and build
    project
    Fixes VSTS #571579 - Reopen solution needed after updating Xamarin.Forms
    package
    3efbb988