Description
The following code throws an exception at runtime when running on an iOS device:
NetworkInterface.GetAllNetworkInterfaces ();
Exception:
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper native-to-managed) void System.Net.NetworkInformation.BsdNetworkInterface/<>c__DisplayClass5_0:<GetBsdNetworkInterfaces>b__0 (intptr,Interop/Sys/IpAddressInfo*)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Net.NetworkInformation.BsdNetworkInterface.GetBsdNetworkInterfaces()
at System.Net.NetworkInformation.NetworkInterfacePal.GetAllNetworkInterfaces()
at System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
at MySingleView.AppDelegate.FinishedLaunching(UIApplication app, NSDictionary options) in /Users/rolf/work/maccore/onedotnet/xamarin-macios/tests/dotnet/MySingleView/AppDelegate.cs:line 43
Repro:
git clone https://github.com/rolfbjarne/xamarin-macios
cd xamarin-macios
git checkout dotnet-attempting-to-jit-compile-method-GetBsdNetworkInterfaces
./configure --enable-dotnet
make reset
make all -j8
make install -j8
make singleview -C tests/dotnet
Complete output
Configuration
.NET 6.0.100-alpha.1.21060.3
Binlog:
MySingleView.binlog.zip
Regression?
No (new feature)