Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Prefer a stable .NET Core version (#4520)
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3609773&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=65256bb7-a34c-5353-bc4d-c02ee25dc133 Some builds have been failing with the following error: BuildJniEnvironment_g_cs: dotnet "/Users/builder/azdo/_work/211/s/xamarin-android/external/Java.Interop/bin/BuildRelease-netcoreapp3.1/jnienv-gen.dll" Java.Interop/JniEnvironment.g.cs obj/Release/netcoreapp3.1//jni.c It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '3.1.2' was not found. - The following frameworks were found: 2.1.12 at [/Users/builder/azdo/_work/_tool/dotnet/shared/Microsoft.NETCore.App] 3.1.0 at [/Users/builder/azdo/_work/_tool/dotnet/shared/Microsoft.NETCore.App] 5.0.0-preview.1.20120.5 at [/Users/builder/azdo/_work/_tool/dotnet/shared/Microsoft.NETCore.App] It seems we have a 3.1 version installed in this case, but perhaps it's not new enough. Attempt to fix the error by always installing both our required preview and stable versions of .NET Core. Installing the stable version last should result in it being the preferred SDK (and the latest appended to $PATH). Duplicating our `UseDotNet` usage, and the side by side nature of .NET Core should allow our projects which require a newer preview to continue to build.
- Loading branch information