From 79dca104fa746eb1be223df3c4c8e900880590f8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 14 Feb 2023 08:47:34 +0100 Subject: [PATCH] [msbuild] Don't add 'native' assets to the hot restart content directory. NuGet adds 'native' assets without a directory component (see https://github.com/dotnet/sdk/issues/9643), which means that for frameworks in NuGets all files in those frameworks are added as plain files, without any information about which subdirectory to put them in. This is obviously wrong, so just don't add any native assets to the content directory. Additionally, frameworks shouldn't be in the hot restart content directory in the first place, because: * They need to be signed in order to execute on the device. * iOS won't allow executing native code from a writeable directory * As such they can't be copied on demand, they have to be installed with the app. --- .../Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets index baaa5c01c5d4..5d0f3a285281 100644 --- a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets +++ b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets @@ -182,7 +182,7 @@ Condition="Exists('%(RootDir)%(Directory)%(Filename).pdb')" /> <_FilesToHotRestartContent Include="@(ReferenceCopyLocalPaths -> Distinct())" - Condition="Exists('$(HotRestartAppBundlePath)\%(Filename)%(Extension)') == 'false' And '%(Extension)' != '.a' And '%(Extension)' != '.dylib' And '%(Extension)' != '.dat'"/> + Condition="Exists('$(HotRestartAppBundlePath)\%(Filename)%(Extension)') == 'false' And '%(Extension)' != '.a' And '%(Extension)' != '.dylib' And '%(Extension)' != '.dat' And '%(ReferenceCopyLocalPaths.AssetType)' != 'native'"/>