From e0f3683b6371247431997ee69c39d0175e1900e7 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 25 Oct 2021 08:14:35 -0500 Subject: [PATCH] [One .NET] properly set $(UseAppHost) to false (#6417) Context: https://github.com/dotnet/sdk/issues/19891 Context: https://github.com/xamarin/xamarin-macios/blob/a6eb528197854c074d9dd5847328c096890337be/dotnet/targets/Xamarin.Shared.Sdk.props#L38-L52 We currently have a small hack in place to prevent Linux packages from being used in .NET 6 builds: <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> The Xamarin.iOS team found if you set this late during `$(AfterMicrosoftNETSdkTargets)`: <_RuntimeIdentifierUsesAppHost>false false Then `Microsoft.NETCore.App.Host.*` packs won't be brought in. After making this change, I can remove this line from the workaround: The final solution for dotnet/sdk#19891, will be a future change that makes `Microsoft.AspNetCore.App.Runtime` have a way to ignore unsupported platforms. --- .../targets/Microsoft.Android.Sdk.Application.targets | 3 +++ .../targets/Microsoft.Android.Sdk.AssemblyResolution.targets | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets index 99650be2236..ef36b33fc11 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Application.targets @@ -9,6 +9,9 @@ This file contains targets specific for Android application projects. + false + + <_RuntimeIdentifierUsesAppHost>false dotnet build "$(MSBuildProjectFullPath)" -target:Run diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index a110214a7a8..b34c5bbdd6e 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -20,7 +20,6 @@ _ResolveAssemblies MSBuild target. <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> -