Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin iOS (PCL) is error System.BadImageFormatException after updating VS2019

thanhtongthanhtong VNMember ✭✭

I updated Visual Studio to latest version. I got this error when build app to iOS simulator.

Error raised at AppDelegate.cs:
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate, IAzureAuthenticationService
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
LoadApplication(new App(this));
catch (Exception ex)

I got the following exception. Could you help me how to fix it? :

System.BadImageFormatException: Cannot box IsByRefLike type 'System.ReadOnlySpan`1'
File name: 'mscorlib'
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ }


  • LandLuLandLu Member, Xamarin Team Xamurai

    BadImageFormatException is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid.
    It seems you want to consume RuntimeMethodInfo. Find out where you call this library and check whether it has been correctly used.

Sign In or Register to comment.