diff --git a/src/AppKit/NSApplication.cs b/src/AppKit/NSApplication.cs index 2eada1d5da8b..1900dc209506 100644 --- a/src/AppKit/NSApplication.cs +++ b/src/AppKit/NSApplication.cs @@ -33,6 +33,7 @@ namespace XamCore.AppKit { public partial class NSApplication : NSResponder { public static bool CheckForIllegalCrossThreadCalls = true; public static bool CheckForEventAndDelegateMismatches = true; + public static bool IgnoreMissingAssembliesDuringRegistration = false; private static Thread mainThread; diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index a03a0d11f4e3..f78f4e6e52a6 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -17,6 +17,10 @@ using XamCore.Foundation; using XamCore.Registrar; +#if MONOMAC +using XamCore.AppKit; +#endif + #if !COREBUILD && (XAMARIN_APPLETLS || XAMARIN_NO_TLS) #if !MMP && !MTOUCH && !MTOUCH_TEST using Mono.Security.Interface; @@ -408,14 +412,13 @@ static void CollectReferencedAssemblies (List assemblies, Assembly ass if (!assemblies.Contains (a)) CollectReferencedAssemblies (assemblies, a); } -#if MONOMAC - catch { + catch (FileNotFoundException fefe) { // that's more important for XI because device builds don't go thru this step // and we can end up with simulator-only failures - bug #29211 - throw; -#else - catch (FileNotFoundException fefe) { NSLog ("Could not find `{0}` referenced by assembly `{1}`.", fefe.FileName, assembly.FullName); +#if MONOMAC + if (!NSApplication.IgnoreMissingAssembliesDuringRegistration) + throw; #endif } }