Reputation: 3274
I created that simple xamarin forms app (with just iOS). It does nothing but referencing that signalr nuget package.
When I build Debug | iPhone
from Visual Studio on my pc (connected to my mac), it builds fine and especially does AOT compilation for Microsoft.AspNetCore.Sockets.Abstractions.dll
(as well as all other dlls).
However, when I build the same solution on Visual Studio for Mac, also on Debug | iPhone
, I get the following error:
Could not AOT the assembly '/Users/francois/AotTests/AotTests/AotTests.iOS/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.AspNetCore.Sockets.Abstractions.dll' (MT3001) (AotTests.iOS)}
Upvotes: 0
Views: 637
Reputation: 430
Bonjour,
This has been fixed in https://github.com/xamarin/xamarin-macios/pull/3791 and we are trying to get it in our next stable release (aka 15.7).
You can try the fix with our continuous builds here: https://github.com/xamarin/xamarin-macios/wiki#continuous-builds.
In this case you want builds from master (hopefully soon from our 15.7 previous currently in alpha/beta).
The NuGet package you added (Microsoft.AspNetCore.SignalR.Client
) was added via a new "package reference" mechanism and had dependencies (other packages) that had both /lib
and /ref
folders.
On the Mac, MSBuild's ResolveAssemblyReferences
target resolved the reference assemblies (in /ref
), passed them to csc
to compile and because of that mtouch
(our packaging tool) was also given those reference assemblies.
The problem is that we can't AOT them, they're only facades and are not made to be packaged.
We solved the issue in Xamarin.iOS (there might be a more general msbuild fix in the future) by stripping the right reference assemblies, given as output by the Nuget targets in _ReferencesFromNuGetPackages
.
Upvotes: 3