From d2f2ca014cbcf750aab004d9808375a39d57a67b Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 27 Mar 2018 22:39:02 -0400 Subject: [PATCH] [msbuild] Skip reference assemblies passed to mtouch (#3791) - Fixes issue #3199: Could not AOT the assembly System.Runtime.CompilerServices.Unsafe.dll (MT3001) (https://github.com/xamarin/xamarin-macios/issues/3199) - Test case: https://www.dropbox.com/s/kxt3isgzn74nq35/Issue3199.zip?dl=0 ### Problem Given a Nuget Package added via the "package reference" mechanism and the said package having netstandard 'lib' **and** 'ref' folders; MTouch was getting reference assemblies and was trying to AOT them. This resulted in an error as those assemblies are only facades. ### Solution 'ResolveNuGetPackageAssets' computes the NuGet packages using their json asset file, adds the full assemblies to 'ReferenceCopyLocalPaths' and outputs the resolved references via '_ReferencesFromNuGetPackages'. This is exactly what "Microsoft.NuGet.Build.Tasks"'s 'ResolveNuGetPackageAssets' target does. --- msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets index 094c23ccfcb1..8e2010f726ae 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets +++ b/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets @@ -780,6 +780,11 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved. Outputs="$(_NativeExecutable);$(DeviceSpecificOutputPath)mtouch.stamp"> + + + + +