From 7e3297578111dedbf4f7041f8a40bc4285b49fd8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 17 May 2023 15:30:49 +0200 Subject: [PATCH] [msbuild] Fix calling the GetFileSystemEntries task on Windows when not connected to a Mac. Given the following truths: * A task will (try to) connect to a Mac if its SessionId property isn't empty. * The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac). It stands to reason that we can't use BuildSessionId to distinguish between connected/not conected status on Windows. Instead introduce a new property, BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if 'IsMacEnabled=true'). Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt). --- dotnet/targets/Xamarin.Shared.Sdk.targets | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 158e7fc7672c..1bec8d97e6ff 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -1882,6 +1882,10 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B <_BindingPackagesFromReferencedAssembliesDirectoriesExists Include="@(_BindingPackagesFromReferencedAssembliesDirectoriesCandidates->Distinct())" Condition="Exists('%(Identity)')" /> + + $(BuildSessionId) + +