diff --git a/src/ObjCRuntime/Runtime.mac.cs b/src/ObjCRuntime/Runtime.mac.cs index d3f7dc6ba7..b3109bde95 100644 --- a/src/ObjCRuntime/Runtime.mac.cs +++ b/src/ObjCRuntime/Runtime.mac.cs @@ -110,14 +110,17 @@ namespace ObjCRuntime { if (initialized) return; +#if !NET if (GC.MaxGeneration <= 0) throw ErrorHelper.CreateError (8017, "The Boehm garbage collector is not supported. Please use SGen instead."); VerifyMonoVersion (); +#endif LookupInternalFunction ("xamarin_initialize") (); } +#if !NET static void VerifyMonoVersion () { // Verify that the system mono we're running against is of a supported version. @@ -150,6 +153,7 @@ namespace ObjCRuntime { throw new NotSupportedException ($"This version of Xamarin.Mac requires Mono {required_version}, but found Mono {actual_version}."); } +#endif unsafe static void InitializePlatform (InitializationOptions* options) {