Xamarin.forms: v3.0 Build Tasks takes dependency on .NET Framework 4.7.1+

Created on 12 May 2018  路  4Comments  路  Source: xamarin/Xamarin.Forms

Description

The recent changes in the build tasks where it's now compiled as a .NET Standard 2.0 assembly means the build task assumes .NET Standard 2.0 assemblies are in the GAC. The result is you must have .NET Framework 4.7.1+ installed to build any project with Xamarin.Forms 3.0.
This poses a very big problem for build servers, where making such a change isn't just a matter of installing another framework. Installing a new framework comes with significant risk, as well as we might not actually have admin access to build servers to do such a thing.
A build task should never require anything above .NET 4.6.1 which is installed with Visual Studio 2017, or 4.5.1 if you want to continue to support building with VS2015.

Steps to Reproduce

Build a Xamarin.Forms UWP, Android or iOS project on a machine without .NET 4.7.1+ installed. Build success with v2.5, but fails with 3.0.

Expected Behavior

Build completes without requiring build server upgrades.

Actual Behavior

image

The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly C:\Projects.nuget\packages\xamarin.forms\3.0.0.446417\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Basic Information

  • Version with issue: v3.0
  • Last known good version: 2.5.x
  • IDE: VS2017.6+

A similar issue was logged here but closed, and not getting any traction and the discussion seems to indicate it's totally reasonable to throw an entirely new framework on your build server: https://github.com/xamarin/Xamarin.Forms/issues/2667

The change was made with this PR: https://github.com/xamarin/Xamarin.Forms/pull/1370

2 bug

All 4 comments

Its a trade off, we can break dotnet-cli compatibility and all associate tools by moving the build task back to compiling with the full desktop framework. However there is effectively no workaround that issue if we revert.

While I recognize that installing .NET 4.7.1 may be uncomfortable for some, there is in fact a mechanism to get to a working build. So its a choice between a world where people are broken and cant fix it and a world where people are broken and can fix it.

If there is a middle ground here that resolves dotnet-cli compatibility without requiring .NET 4.7.1 I would be happy to consider it.

@jassmith Nevermind the fact that you will also be forced to update your build servers to later builds, because the .NET Framework isn't supported until Creators Update. And that's IF you actually have the admin access required to do any of this.

I'm curious what you're saying wasn't possible with .NET 4.6.1, or a lower ,NET Standard version ?

I am confused. Building Xamarin Forms 3.0 apps requires .NET 4.7.1+, but building Xamarin Forms from master branch requires .NET 4.7:

image

In my case I have .NET 4.7.2 installed (I checked registry, and release number is 461808).
It appears that building from source, requires exactly .NET 4.7 to be installed, doesn't work with newer .NET versions.

The issue is reproducible on Xamarin.Forms.3.2.0.729530-pre2.nupkg

Was this page helpful?
0 / 5 - 0 ratings