From a2d6bbb1783a8fd5ce4da8e85d1434354b2ff085 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:58:28 +0200 Subject: [PATCH] [release/9.0.1xx-preview6] Update dependencies from dotnet/sdk (#20773) This pull request updates the following dependencies ## Coherency Updates The following updates ensure that dependencies with a *CoherentParentDependency* attribute were produced in a build used as input to the parent dependency's build. See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview) - **Coherency Updates**: - **Microsoft.NET.ILLink.Tasks**: from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8 (parent: VS.Tools.Net.Core.SDK.Resolver) - **Microsoft.AspNetCore.App.Ref**: from 9.0.0-preview.5.24256.2 to 9.0.0-preview.6.24322.1 (parent: VS.Tools.Net.Core.SDK.Resolver) - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8 (parent: VS.Tools.Net.Core.SDK.Resolver) - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.0-preview.5.24223.2 to 9.0.0-preview.6.24319.1 (parent: Microsoft.NETCore.App.Ref) - **Microsoft.NETCore.App.Ref**: from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8 (parent: VS.Tools.Net.Core.SDK.Resolver) - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.24230.1 to 0.11.4-alpha.24313.1 (parent: Microsoft.NETCore.App.Ref) ## From https://github.com/dotnet/sdk - **Subscription**: 33f2d805-f028-40e1-9762-08dc94685a28 - **Build**: 20240624.5 - **Date Produced**: June 24, 2024 11:13:14 AM UTC - **Commit**: 09d2448d624709773e31418b85273f02b40a8f6a - **Branch**: refs/heads/release/9.0.1xx-preview6 - **Updates**: - **VS.Tools.Net.Core.SDK.Resolver**: [from 9.0.100-preview.5.24262.2 to 9.0.100-preview.6.24324.5][1] - **Microsoft.NET.ILLink.Tasks**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8][2] - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-preview.5.24256.2 to 9.0.0-preview.6.24322.1][3] - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8][2] - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: [from 9.0.0-preview.5.24223.2 to 9.0.0-preview.6.24319.1][4] - **Microsoft.NETCore.App.Ref**: [from 9.0.0-preview.5.24256.1 to 9.0.0-preview.6.24321.8][2] - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.24230.1 to 0.11.4-alpha.24313.1][5] [1]: https://github.com/dotnet/sdk/compare/1741345c63...09d2448d62 [2]: https://github.com/dotnet/runtime/compare/84b3339505...89a244e88c [3]: https://github.com/dotnet/aspnetcore/compare/da3aa27233...68adb02eb4 [4]: https://github.com/dotnet/emsdk/compare/53288f87c5...9880d891dd [5]: https://github.com/dotnet/cecil/compare/7a4a59f9f6...d145726036 --- eng/Version.Details.xml | 26 ++++++++-------- eng/Versions.props | 8 ++--- global.json | 2 +- src/Foundation/NSUrlSessionHandler.cs | 4 +++ tests/common/BinLog.cs | 2 ++ tests/dotnet/UnitTests/PostBuildTest.cs | 19 ++++++++++-- tests/introspection/ApiTypeTest.cs | 5 +++ tests/linker/ios/link sdk/ReflectionTest.cs | 18 +++++++---- .../CoreMidi/MidiThruConnectionParamsTest.cs | 31 ++++++++++--------- .../System.Net.Http/MessageHandlers.cs | 8 +++++ tools/common/Target.cs | 14 +++++++++ .../Steps/ManagedRegistrarLookupTablesStep.cs | 18 +++++++++++ 12 files changed, 113 insertions(+), 42 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e1010974f719..371d7a4a3975 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,34 +1,34 @@ - - https://github.com/dotnet/installer - 1741345c6399ae203d8f259fb12fb873dac5129d + + https://github.com/dotnet/sdk + 09d2448d624709773e31418b85273f02b40a8f6a https://github.com/dotnet/runtime cf47d9ff6827a3e1d6f2acbf925cd618418f20dd - + https://github.com/dotnet/runtime - 84b33395057737db3ea342a5151feb6b90c1b6f6 + 89a244e88cdcf0242987f9f516b40d16b5382eb8 - + https://github.com/dotnet/runtime - 84b33395057737db3ea342a5151feb6b90c1b6f6 + 89a244e88cdcf0242987f9f516b40d16b5382eb8 - + https://github.com/dotnet/aspnetcore - da3aa27233a2cec2f6780884f71934b2f5e686ce + 68adb02eb4217bad645d165f10355e346b693a5e - + https://github.com/dotnet/emsdk - 53288f87c588907e8ff01f129786820fe998573c + 9880d891ddfddee1b1182c149468a43b89c090a0 - + https://github.com/dotnet/cecil - 7a4a59f9f66baf6711a6ce2de01d3b2c62ed72d8 + d145726036eb9c09a0e3cf03c4f70effd3b31cd7 diff --git a/eng/Versions.props b/eng/Versions.props index 7ee86df2ca71..17bbaa696512 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,15 +3,15 @@ - 9.0.100-preview.5.24262.2 - 9.0.0-preview.5.24256.1 + 9.0.100-preview.6.24324.5 + 9.0.0-preview.6.24321.8 9.0.0-alpha.1.23556.4 8.0.0-beta.24225.1 - 9.0.0-preview.5.24256.1 + 9.0.0-preview.6.24321.8 8.0.0-rtm.23511.3 9.0.0-alpha.1.23556.4 7.0.100-alpha.1.21601.1 - 0.11.4-alpha.24230.1 + 0.11.4-alpha.24313.1 9.0.0-prerelease.24312.3 $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version) diff --git a/global.json b/global.json index eb0731c26816..2a4c6ffedc35 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "9.0.100-preview.5.24262.2" + "version": "9.0.100-preview.6.24324.5" } } diff --git a/src/Foundation/NSUrlSessionHandler.cs b/src/Foundation/NSUrlSessionHandler.cs index 638211139a35..fd45db0846fa 100644 --- a/src/Foundation/NSUrlSessionHandler.cs +++ b/src/Foundation/NSUrlSessionHandler.cs @@ -158,7 +158,11 @@ public NSUrlSessionHandler (NSUrlSessionConfiguration configuration) allowsCellularAccess = configuration.AllowsCellularAccess; AllowAutoRedirect = true; +#pragma warning disable SYSLIB0014 + // SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) + // https://github.com/xamarin/xamarin-macios/issues/20764 var sp = ServicePointManager.SecurityProtocol; +#pragma warning restore SYSLIB0014 if ((sp & SecurityProtocolType.Ssl3) != 0) configuration.TLSMinimumSupportedProtocol = SslProtocol.Ssl_3_0; else if ((sp & SecurityProtocolType.Tls) != 0) diff --git a/tests/common/BinLog.cs b/tests/common/BinLog.cs index f1ddbaba8608..08ed3043e39a 100644 --- a/tests/common/BinLog.cs +++ b/tests/common/BinLog.cs @@ -294,6 +294,8 @@ public static bool TryFindPropertyValue (string binlog, string property, [NotNul if (propname == property) value = propvalue; } + } else if (bmea.Message?.StartsWith ($"TaskOutput: {property}") == true) { + value = bmea.Message?.Substring ($"TaskOutput: {property}".Length).Trim (); } } } diff --git a/tests/dotnet/UnitTests/PostBuildTest.cs b/tests/dotnet/UnitTests/PostBuildTest.cs index 38e7587b755b..310a1cb71fe3 100644 --- a/tests/dotnet/UnitTests/PostBuildTest.cs +++ b/tests/dotnet/UnitTests/PostBuildTest.cs @@ -29,9 +29,22 @@ public void ArchiveTest (ApplePlatform platform, string runtimeIdentifiers) var result = DotNet.AssertBuild (project_path, properties); var recordArgs = BinLog.ReadBuildEvents (result.BinLogPath).ToList (); var findString = "Output Property: ArchiveDir"; - var archiveDirRecord = recordArgs.Where (v => v?.Message?.Contains (findString) == true).ToList (); - Assert.That (archiveDirRecord.Count, Is.GreaterThan (0), "ArchiveDir"); - var archiveDir = archiveDirRecord [0].Message?.Substring (findString.Length + 1)?.Trim (); + var findString2 = "TaskOutput: ArchiveDir"; + var archiveDirs = recordArgs. + Select (v => v?.Message). + Select (v => { + if (v is null) + return null; + if (v.Contains (findString)) + return v.Substring (findString.Length + 1); + if (v.Contains (findString2)) + return v.Substring (findString2.Length + 1); + return null; + }). + Where (v => v is not null). + ToList (); + Assert.That (archiveDirs.Count, Is.GreaterThan (0), "ArchiveDir"); + var archiveDir = archiveDirs [0]!.Trim (); Assert.That (archiveDir, Does.Exist, "Archive directory existence"); AssertDSymDirectory (appPath); } diff --git a/tests/introspection/ApiTypeTest.cs b/tests/introspection/ApiTypeTest.cs index cdc8eb5c43e8..72f45c77fea9 100644 --- a/tests/introspection/ApiTypeTest.cs +++ b/tests/introspection/ApiTypeTest.cs @@ -50,6 +50,11 @@ public void StaticCtor () if (Skip (t)) continue; + if (t.IsGenericTypeDefinition) { + // https://github.com/dotnet/runtime/issues/103891 + continue; + } + var cctor = t.GetConstructor (BindingFlags.Static | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (cctor is null) continue; diff --git a/tests/linker/ios/link sdk/ReflectionTest.cs b/tests/linker/ios/link sdk/ReflectionTest.cs index 2f3e1a8a6b04..62a841f9e3f3 100644 --- a/tests/linker/ios/link sdk/ReflectionTest.cs +++ b/tests/linker/ios/link sdk/ReflectionTest.cs @@ -11,11 +11,6 @@ namespace Linker.Shared.Reflection { // we want the tests to be available because we use the linker [Preserve (AllMembers = true)] public class ReflectionTest { - - public void MethodWithParameters (string firstParameter, int secondParameter) - { - } - [Test] public void ParameterInfoName () { @@ -23,7 +18,12 @@ public void ParameterInfoName () // however it's used inside mscorlib.dll (and SDK) so it cannot be checked while testing //Assert.Null (typeof (ParameterInfo).GetProperty ("Name"), "Name"); - var mi = this.GetType ().GetMethod ("MethodWithParameters"); + // Call the method we want to test, so that the linker doesn't remove it. + // The method needs to be in a different class, because this class has the Preserve attribute, + // and the linker will keep the parameter names inside such classes. + ReflectionTestClass.MethodWithParameters (null, 0); + + var mi = GetType ().Assembly.GetType ("Linker.Shared.Reflection.ReflectionTestClass").GetMethod ("MethodWithParameters"); var p = mi.GetParameters (); #if DEBUG && !NET // dotnet has adopted (and adapted) the metadata reducer and runs it on it's own conditions @@ -43,4 +43,10 @@ public void ParameterInfoName () } } } + + class ReflectionTestClass { + public static void MethodWithParameters (string firstParameter, int secondParameter) + { + } + } } diff --git a/tests/monotouch-test/CoreMidi/MidiThruConnectionParamsTest.cs b/tests/monotouch-test/CoreMidi/MidiThruConnectionParamsTest.cs index fb0cd4b5a265..550a01d38838 100644 --- a/tests/monotouch-test/CoreMidi/MidiThruConnectionParamsTest.cs +++ b/tests/monotouch-test/CoreMidi/MidiThruConnectionParamsTest.cs @@ -49,15 +49,16 @@ static byte [] DefaultChannelMap { } } -#if NET -#if RELEASE - string ParameterSuffix = " Arg_ParamName_Name, value"; -#else - string ParameterSuffix = " (Parameter 'value')"; -#endif -#else - string ParameterSuffix = "\nParameter name: value"; -#endif + string [] parameterSuffixes = new string [] { + " Arg_ParamName_Name, value", + " (Parameter 'value')", + "\nParameter name: value", + }; + + void AssertAreEqualWithAnySuffix (string expectedWithoutSuffix, string actual, string message) + { + Assert.That (actual, Is.AnyOf (parameterSuffixes.Select (suffix => expectedWithoutSuffix + suffix).ToArray ()), message); + } [Test] public void ParamsTest () @@ -112,7 +113,7 @@ public void PropertiesTest_Sources () // Set to more than 8 sources var ex = Assert.Throws (() => { p.Sources = new MidiThruConnectionEndpoint [9]; }, "Sources 4"); - Assert.AreEqual ($"A maximum of 8 endpoints are allowed{ParameterSuffix}", ex.Message, "Sources 4b"); + AssertAreEqualWithAnySuffix ($"A maximum of 8 endpoints are allowed", ex.Message, "Sources 4b"); } [Test] @@ -138,7 +139,7 @@ public void PropertiesTest_Destinations () // Set to more than 8 destinations var ex = Assert.Throws (() => { p.Destinations = new MidiThruConnectionEndpoint [9]; }, "Sources 4"); - Assert.AreEqual ($"A maximum of 8 endpoints are allowed{ParameterSuffix}", ex.Message, "Destinations 4b"); + AssertAreEqualWithAnySuffix ($"A maximum of 8 endpoints are allowed", ex.Message, "Destinations 4b"); } [Test] @@ -199,7 +200,7 @@ public void PropertiesTest_ChannelMap () // Set to more than 16 channels var ex = Assert.Throws (() => { p.ChannelMap = new byte [] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 }; }, "ChannelMap 4"); - Assert.AreEqual ($"A maximum of 16 channels are allowed{ParameterSuffix}", ex.Message, "ChannelMap 4b"); + AssertAreEqualWithAnySuffix ($"A maximum of 16 channels are allowed", ex.Message, "ChannelMap 4b"); } [Test] @@ -534,7 +535,7 @@ public void PropertiesTest_Controls () // Set to a big array; the field with the number of controls is a UInt16, so overflow by one var toobigArray = new MidiControlTransform [1 + (int) ushort.MaxValue]; var ex = Assert.Throws (() => { p.Controls = toobigArray; }, "Controls 4"); - Assert.AreEqual ($"A maximum of {ushort.MaxValue} controls are allowed{ParameterSuffix}", ex?.Message, "Controls 4b"); + AssertAreEqualWithAnySuffix ($"A maximum of {ushort.MaxValue} controls are allowed", ex?.Message, "Controls 4b"); // Set to the maximum sized array; the field with the number of maps is a UInt16, so create exactly that var bigArray = new MidiControlTransform [ushort.MaxValue]; @@ -575,7 +576,7 @@ public void PropertiesTest_Maps () // Set to a too big array; the field with the number of maps is a UInt16, so overflow by one var toobigArray = new MidiValueMap [1 + (int) ushort.MaxValue]; var ex = Assert.Throws (() => { p.Maps = toobigArray; }, "Maps 4"); - Assert.AreEqual ($"A maximum of {ushort.MaxValue} maps are allowed{ParameterSuffix}", ex?.Message, "Maps 4b"); + AssertAreEqualWithAnySuffix ($"A maximum of {ushort.MaxValue} maps are allowed", ex?.Message, "Maps 4b"); // Set to the maximum sized array; the field with the number of maps is a UInt16, so create exactly that var bigArray = new MidiValueMap [ushort.MaxValue]; @@ -1029,7 +1030,7 @@ public void MidiValueMapTest () var bytes = new byte [42]; var ex = Assert.Throws (() => { map.Value = bytes; }, "Invalid byte array"); - Assert.AreEqual ($"The length of the Value array must be 128{ParameterSuffix}", ex.Message, "Ex Message"); + AssertAreEqualWithAnySuffix ($"The length of the Value array must be 128", ex.Message, "Ex Message"); bytes = new byte [128]; bytes [42] = 36; diff --git a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs index d08d7185c80e..c6c954c2ff0b 100644 --- a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs +++ b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs @@ -470,7 +470,9 @@ public void RejectSslCertificatesServicePointManager (Type handlerType) // return false, since we want to test that the exception is raised return false; }; +#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => { +#pragma warning restore SYSLIB0014 invalidServicePointManagerCbWasExcuted = true; return false; }; @@ -511,7 +513,9 @@ public void RejectSslCertificatesServicePointManager (Type handlerType) client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue ("Basic", Convert.ToBase64String (byteArray)); result = await client.GetAsync (NetworkResources.Httpbin.GetRedirectUrl (3)); } finally { +#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) ServicePointManager.ServerCertificateValidationCallback = null; +#pragma warning restore SYSLIB0014 } }, out var ex); @@ -551,7 +555,9 @@ public void AcceptSslCertificatesServicePointManager (Type handlerType) return true; }; } else { +#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => { +#pragma warning restore SYSLIB0014 // servicePointManagerCbWasExcuted = true; return true; }; @@ -565,7 +571,9 @@ public void AcceptSslCertificatesServicePointManager (Type handlerType) client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue ("Basic", Convert.ToBase64String (byteArray)); var result = await client.GetAsync (NetworkResources.Httpbin.GetRedirectUrl (3)); } finally { +#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) ServicePointManager.ServerCertificateValidationCallback = null; +#pragma warning restore SYSLIB0014 } }, out var ex); diff --git a/tools/common/Target.cs b/tools/common/Target.cs index 3afd261f0a76..956d1e34546a 100644 --- a/tools/common/Target.cs +++ b/tools/common/Target.cs @@ -933,10 +933,15 @@ void GenerateIOSMain (StringWriter sw, Abi abi) sw.WriteLine ("}"); } +#if NET + static readonly char [] charsToReplaceAot = new [] { '.', '-', '+', '<', '>' }; +#endif static string EncodeAotSymbol (string symbol) { var sb = new StringBuilder (); /* This mimics what the aot-compiler does */ + // https://github.com/dotnet/runtime/blob/2f08fcbfece0c09319f237a6aee6f74c4a9e14e8/src/mono/mono/metadata/native-library.c#L1265-L1284 + // https://github.com/dotnet/runtime/blob/2f08fcbfece0c09319f237a6aee6f74c4a9e14e8/src/tasks/Common/Utils.cs#L419-L445 foreach (var b in System.Text.Encoding.UTF8.GetBytes (symbol)) { char c = (char) b; if ((c >= '0' && c <= '9') || @@ -944,8 +949,17 @@ static string EncodeAotSymbol (string symbol) (c >= 'A' && c <= 'Z')) { sb.Append (c); continue; +#if NET + } else if (charsToReplaceAot.Contains (c)) { + sb.Append ('_'); + } else { + // Append the hex representation of b between underscores + sb.Append ($"_{b:X}_"); +#endif } +#if !NET sb.Append ('_'); +#endif } return sb.ToString (); } diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs index a731cbc68cc6..03c117eba8bd 100644 --- a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs +++ b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs @@ -418,12 +418,27 @@ void GenerateConstructINativeObject (TypeDefinition registrarType) il.Emit (OpCodes.Ret); } + void AddTypeInterfaceImplementation (TypeDefinition type, TypeReference iface) + { + if (type.HasInterfaces && type.Interfaces.Any (v => v.InterfaceType == iface)) + return; + + var ifaceImplementation = new InterfaceImplementation (iface); + type.Interfaces.Add (ifaceImplementation); + Annotations.Mark (ifaceImplementation); + Annotations.Mark (ifaceImplementation.InterfaceType); + Annotations.Mark (ifaceImplementation.InterfaceType.Resolve ()); + } + void ImplementConstructNSObjectFactoryMethod (TypeDefinition type, MethodReference ctor) { // skip creating the factory for NSObject itself if (type.Is ("Foundation", "NSObject")) return; + // Make sure the type implements INSObjectFactory, otherwise we can't override the _Xamarin_ConstructNSObject method from it. + AddTypeInterfaceImplementation (type, abr.Foundation_INSObjectFactory); + var createInstanceMethod = type.AddMethod ("_Xamarin_ConstructNSObject", MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.NewSlot | MethodAttributes.HideBySig, abr.Foundation_NSObject); var nativeHandleParameter = createInstanceMethod.AddParameter ("nativeHandle", abr.ObjCRuntime_NativeHandle); abr.Foundation_INSObjectFactory.Resolve ().IsPublic = true; @@ -456,6 +471,9 @@ void ImplementConstructINativeObjectFactoryMethod (TypeDefinition type, MethodRe if (nsobjectConstructor is null && ctor is null) return; + // Make sure the type implements INativeObject, otherwise we can't override the _Xamarin_ConstructINativeObject method from it. + AddTypeInterfaceImplementation (type, abr.ObjCRuntime_INativeObject); + var createInstanceMethod = type.AddMethod ("_Xamarin_ConstructINativeObject", MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.NewSlot | MethodAttributes.HideBySig, abr.ObjCRuntime_INativeObject); var nativeHandleParameter = createInstanceMethod.AddParameter ("nativeHandle", abr.ObjCRuntime_NativeHandle); var ownsParameter = createInstanceMethod.AddParameter ("owns", abr.System_Boolean);