Fixes COM warnings (#52176)
authorLakshan Fernando <lakshanf@hotmail.com>
Fri, 7 May 2021 14:39:16 +0000 (07:39 -0700)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 14:39:16 +0000 (07:39 -0700)
* Fixes COm warnings

* fb

* feedback

* missed one name change

* Update docs/workflow/trimming/feature-switches.md

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
13 files changed:
docs/workflow/trimming/feature-switches.md
src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.xml
src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivationContextInternal.cs
src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
src/coreclr/vm/ecalllist.h
src/coreclr/vm/eeconfig.cpp
src/coreclr/vm/marshalnative.cpp
src/coreclr/vm/marshalnative.h
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Suppressions.Shared.xml
src/libraries/System.Runtime.InteropServices/tests/ComDisabled/System.Runtime.InteropServices.ComDisabled.Tests.csproj
src/libraries/System.Runtime.InteropServices/tests/ComDisabled/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs

index 1171f8fb4b6d20f6aeddd99bdad44eb1e192e4b4..84f4aad6faba868289a6a08e5c8ca35a37fc45dd 100644 (file)
@@ -20,6 +20,7 @@ configurations but their defaults might vary as any SDK can set the defaults dif
 | TBD | System.Threading.ThreadPool.EnableDispatchAutoreleasePool | When set to true, creates an NSAutoreleasePool around each thread pool work item on applicable platforms. |
 | CustomResourceTypesSupport | System.Resources.ResourceManager.AllowCustomResourceTypes | Use of custom resource types is disabled when set to false. ResourceManager code paths that use reflection for custom types can be trimmed. |
 | EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization | System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization | BinaryFormatter serialization support is trimmed when set to false. |
+| BuiltInComInteropSupport | System.Runtime.InteropServices.BuiltInComInterop.IsSupported | Built-in COM support is trimmed when set to false. |
 
 Any feature-switch which defines property can be set in csproj file or
 on the command line as any other MSBuild property. Those without predefined property name
index 7953cca3a6c10bbf994212c8c9d7b20d09425007..ef9f087a33e80b79d7b576649c137591e4a9eb6c 100644 (file)
@@ -3,5 +3,8 @@
     <type fullname="System.StartupHookProvider" feature="System.StartupHookProvider.IsSupported" featurevalue="false">
       <method signature="System.Boolean get_IsSupported()" body="stub" value="false" />
     </type>
+    <type fullname="System.Runtime.InteropServices.Marshal" feature="System.Runtime.InteropServices.BuiltInComInterop.IsSupported" featurevalue="false">
+      <method signature="System.Boolean get_IsBuiltInComSupported()" body="stub" value="false" />
+    </type>
   </assembly>
-</linker>
\ No newline at end of file
+</linker>
index 015843165977f909a02b16efb9d4aa45ec0ce8d2..1db025ed86581d1072d8fc5718279799ec0cfbee 100644 (file)
@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System;
+using System.Diagnostics.CodeAnalysis;
 using System.Runtime.InteropServices;
 
 namespace Internal.Runtime.InteropServices
@@ -39,6 +40,7 @@ namespace Internal.Runtime.InteropServices
     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
     public interface IClassFactory
     {
+        [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         void CreateInstance(
             [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter,
             ref Guid riid,
index d28441194f4a367c725f6b3dcd1018feef3368e0..37a324445468c2e864628a6ca1500c35d4973eba 100644 (file)
@@ -35,6 +35,7 @@ namespace Internal.Runtime.InteropServices
     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
     internal interface IClassFactory2 : IClassFactory
     {
+        [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         new void CreateInstance(
             [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter,
             ref Guid riid,
@@ -62,7 +63,7 @@ namespace Internal.Runtime.InteropServices
         [CLSCompliant(false)]
         public static unsafe ComActivationContext Create(ref ComActivationContextInternal cxtInt)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -92,7 +93,7 @@ namespace Internal.Runtime.InteropServices
         [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         public static object GetClassFactoryForType(ComActivationContext cxt)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -126,7 +127,7 @@ namespace Internal.Runtime.InteropServices
         [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         public static void ClassRegistrationScenarioForType(ComActivationContext cxt, bool register)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -222,7 +223,7 @@ namespace Internal.Runtime.InteropServices
         [UnmanagedCallersOnly]
         public static unsafe int GetClassFactoryForTypeInternal(ComActivationContextInternal* pCxtInt)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -265,7 +266,7 @@ $@"{nameof(GetClassFactoryForTypeInternal)} arguments:
         [UnmanagedCallersOnly]
         public static unsafe int RegisterClassForTypeInternal(ComActivationContextInternal* pCxtInt)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -311,7 +312,7 @@ $@"{nameof(RegisterClassForTypeInternal)} arguments:
         [UnmanagedCallersOnly]
         public static unsafe int UnregisterClassForTypeInternal(ComActivationContextInternal* pCxtInt)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -364,6 +365,7 @@ $@"{nameof(UnregisterClassForTypeInternal)} arguments:
             Debug.WriteLine(fmt, args);
         }
 
+        [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         private static Type FindClassType(Guid clsid, string assemblyPath, string assemblyName, string typeName)
         {
             try
@@ -489,6 +491,7 @@ $@"{nameof(UnregisterClassForTypeInternal)} arguments:
                 }
             }
 
+            [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
             public void CreateInstance(
                 [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter,
                 ref Guid riid,
@@ -524,6 +527,7 @@ $@"{nameof(UnregisterClassForTypeInternal)} arguments:
                 _classType = classType;
             }
 
+            [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
             public void CreateInstance(
                 [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter,
                 ref Guid riid,
index 46ea1bb35438c8d96167893fcb38c2b27f23637a..ddc25611df49a1c1e0a50b6d0108af1a0bff6d3d 100644 (file)
@@ -196,7 +196,7 @@ namespace System.Runtime.InteropServices
         private static extern void InternalPrelink(RuntimeMethodHandleInternal m);
 
         [DllImport(RuntimeHelpers.QCall)]
-        private static extern bool IsComSupportedInternal();
+        private static extern bool IsBuiltInComSupportedInternal();
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         public static extern /* struct _EXCEPTION_POINTERS* */ IntPtr GetExceptionPointers();
@@ -236,9 +236,7 @@ namespace System.Runtime.InteropServices
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsPinnable(object? obj);
 
-        internal static bool IsComSupported { get; } = InitializeIsComSupported();
-
-        private static bool InitializeIsComSupported() => IsComSupportedInternal();
+        internal static bool IsBuiltInComSupported { get; } = IsBuiltInComSupportedInternal();
 
 #if TARGET_WINDOWS
         /// <summary>
@@ -296,7 +294,7 @@ namespace System.Runtime.InteropServices
         // on Marshal for more consistent API surface.
         internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -443,7 +441,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -457,7 +455,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o) where T : notnull
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -484,7 +482,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static int ReleaseComObject(object o)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -512,7 +510,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static int FinalReleaseComObject(object o)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -536,7 +534,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static object? GetComObjectData(object obj, object key)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -567,7 +565,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static bool SetComObjectData(object obj, object key, object? data)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -597,7 +595,7 @@ namespace System.Runtime.InteropServices
         [return: NotNullIfNotNull("o")]
         public static object? CreateWrapperOfType(object? o, Type t)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -652,7 +650,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static TWrapper CreateWrapperOfType<T, TWrapper>(T? o)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -672,7 +670,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static void GetNativeVariantForObject(object? obj, /* VARIANT * */ IntPtr pDstNativeVariant)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -686,7 +684,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static void GetNativeVariantForObject<T>(T? obj, IntPtr pDstNativeVariant)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -697,7 +695,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static object? GetObjectForNativeVariant(/* VARIANT * */ IntPtr pSrcNativeVariant)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -711,7 +709,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static T? GetObjectForNativeVariant<T>(IntPtr pSrcNativeVariant)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -722,7 +720,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static object?[] GetObjectsForNativeVariants(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -736,7 +734,7 @@ namespace System.Runtime.InteropServices
         [SupportedOSPlatform("windows")]
         public static T[] GetObjectsForNativeVariants<T>(IntPtr aSrcNativeVariant, int cVars)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -764,10 +762,11 @@ namespace System.Runtime.InteropServices
         [MethodImpl(MethodImplOptions.InternalCall)]
         public static extern int GetEndComSlot(Type t);
 
+        [RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
         [SupportedOSPlatform("windows")]
         public static object BindToMoniker(string monikerName)
         {
-            if (!IsComSupported)
+            if (!IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
@@ -780,12 +779,19 @@ namespace System.Runtime.InteropServices
             return obj;
         }
 
+        // Revist after https://github.com/mono/linker/issues/1989 is fixed
+        [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
+            Justification = "The calling method is annotated with RequiresUnreferencedCode")]
         [DllImport(Interop.Libraries.Ole32, PreserveSig = false)]
         private static extern void CreateBindCtx(uint reserved, out IBindCtx ppbc);
 
+        [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
+            Justification = "The calling method is annotated with RequiresUnreferencedCode")]
         [DllImport(Interop.Libraries.Ole32, PreserveSig = false)]
         private static extern void MkParseDisplayName(IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IMoniker ppmk);
 
+        [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
+            Justification = "The calling method is annotated with RequiresUnreferencedCode")]
         [DllImport(Interop.Libraries.Ole32, PreserveSig = false)]
         private static extern void BindMoniker(IMoniker pmk, uint grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult);
 
index f645ad15a40735d022e8fec8b026075c902d8b04..d01d077b473689073ac0631e8f5a76b5ea98f234 100644 (file)
@@ -3680,7 +3680,7 @@ namespace System
             Type[] aArgsTypes,
             Type retType)
         {
-            if (!Marshal.IsComSupported)
+            if (!Marshal.IsBuiltInComSupported)
             {
                 throw new NotSupportedException(SR.NotSupported_COM);
             }
index d309500d50f940c6ddc4fd7026340ac04e1f980c..eacef79a9b9ab0c7a50af2e17e8185e839d501b0 100644 (file)
@@ -758,7 +758,7 @@ FCFuncStart(gInteropMarshalFuncs)
     FCFuncElement("OffsetOfHelper", MarshalNative::OffsetOfHelper)
 
     QCFuncElement("InternalPrelink", MarshalNative::Prelink)
-    QCFuncElement("IsComSupportedInternal", MarshalNative::IsComSupported)
+    QCFuncElement("IsBuiltInComSupportedInternal", MarshalNative::IsBuiltInComSupported)
     FCFuncElement("GetExceptionForHRInternal", MarshalNative::GetExceptionForHR)
     FCFuncElement("GetDelegateForFunctionPointerInternal", MarshalNative::GetDelegateForFunctionPointerInternal)
     FCFuncElement("GetFunctionPointerForDelegateInternal", MarshalNative::GetFunctionPointerForDelegateInternal)
index 778edeadae63cc48f42a37534cfe20912ee01d07..b3bf5bde94bd140594279f5a1eee5fcacbaadaaa 100644 (file)
@@ -683,7 +683,7 @@ HRESULT EEConfig::sync()
         bLogCCWRefCountChange = true;
 
     fEnableRCWCleanupOnSTAShutdown = (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_EnableRCWCleanupOnSTAShutdown) != 0);
-    m_fBuiltInCOMInteropSupported = Configuration::GetKnobBooleanValue(W("System.Runtime.InteropServices.Marshal.IsComSupported"), true);
+    m_fBuiltInCOMInteropSupported = Configuration::GetKnobBooleanValue(W("System.Runtime.InteropServices.BuiltInComInterop.IsSupported"), true);
 #endif // FEATURE_COMINTEROP
 
 #ifdef _DEBUG
index 86046fccdcec4b489a64e0e31b25c403c5350119..01702b772e12719d4832018de8f52cdb281b3223 100644 (file)
@@ -69,10 +69,10 @@ VOID QCALLTYPE MarshalNative::Prelink(MethodDesc * pMD)
     END_QCALL;
 }
 
-// IsComSupported
+// IsBuiltInComSupported
 // Built-in COM support is only checked from the native side to ensure the runtime
 // is in a consistent state
-BOOL QCALLTYPE MarshalNative::IsComSupported()
+BOOL QCALLTYPE MarshalNative::IsBuiltInComSupported()
 {
     QCALL_CONTRACT;
 
index 5971225d22d59dac18a0119ae42e2c7e0e8c07d4..3036d38f5e5e659bf2fa34fee257620e0d3efcc1 100644 (file)
@@ -20,7 +20,7 @@ class MarshalNative
 {
 public:
     static VOID QCALLTYPE Prelink(MethodDesc * pMD);
-    static BOOL QCALLTYPE IsComSupported();
+    static BOOL QCALLTYPE IsBuiltInComSupported();
 
     //====================================================================
     // These methods convert between an HR and and a managed exception.
index 5b8326f6ff097953b1acd7a9fa6a3aefacc5dbfb..2b5f6ef8918c0f744863e754421a8b38e5eba853 100644 (file)
@@ -1,12 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <linker>
   <assembly fullname="System.Private.CoreLib, PublicKeyToken=7cec85d7bea7798e">
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2026</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:Internal.Runtime.InteropServices.ComActivator.FindClassType(System.Guid,System.String,System.String,System.String)</property>
-    </attribute>
     <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
       <argument>ILLink</argument>
       <argument>IL2072</argument>
       <property name="Scope">member</property>
       <property name="Target">M:Internal.Runtime.InteropServices.IsolatedComponentLoadContext.Load(System.Reflection.AssemblyName)</property>
     </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2050</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:System.Runtime.InteropServices.Marshal.BindMoniker(System.Runtime.InteropServices.ComTypes.IMoniker,System.UInt32,System.Guid@,System.Object@)</property>
-    </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2050</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:System.Runtime.InteropServices.Marshal.CreateBindCtx(System.UInt32,System.Runtime.InteropServices.ComTypes.IBindCtx@)</property>
-    </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2050</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:System.Runtime.InteropServices.Marshal.MkParseDisplayName(System.Runtime.InteropServices.ComTypes.IBindCtx,System.String,System.UInt32@,System.Runtime.InteropServices.ComTypes.IMoniker@)</property>
-    </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2057</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:Internal.Runtime.InteropServices.ComActivator.ClassRegistrationScenarioForType(Internal.Runtime.InteropServices.ComActivationContext,System.Boolean)</property>
-    </attribute>
     <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
       <argument>ILLink</argument>
       <argument>IL2057</argument>
       <property name="Scope">member</property>
       <property name="Target">M:Internal.Runtime.InteropServices.ComponentActivator.InternalGetFunctionPointer(System.Runtime.Loader.AssemblyLoadContext,System.String,System.String,System.IntPtr)</property>
     </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2075</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:Internal.Runtime.InteropServices.ComActivator.ClassRegistrationScenarioForType(Internal.Runtime.InteropServices.ComActivationContext,System.Boolean)</property>
-    </attribute>
     <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
       <argument>ILLink</argument>
       <argument>IL2075</argument>
       <property name="Scope">member</property>
       <property name="Target">M:Internal.Runtime.InteropServices.ComponentActivator.InternalGetFunctionPointer(System.Runtime.Loader.AssemblyLoadContext,System.String,System.String,System.IntPtr)</property>
     </attribute>
-    <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
-      <argument>ILLink</argument>
-      <argument>IL2077</argument>
-      <property name="Scope">member</property>
-      <property name="Target">M:Internal.Runtime.InteropServices.ComActivator.BasicClassFactory.CreateInstance(System.Object,System.Guid@,System.IntPtr@)</property>
-    </attribute>
   </assembly>
 </linker>
index f06c7c65cd2e216d2b6eed5743204f4c143aa03b..e0e9e306d07009bb786c65ab1013ecd6938052e0 100644 (file)
@@ -10,6 +10,6 @@
     <Compile Include="System\Runtime\InteropServices\Marshal\MarshalComDisabledTests.cs" />
   </ItemGroup>
   <ItemGroup>
-    <RuntimeHostConfigurationOption Include="System.Runtime.InteropServices.Marshal.IsComSupported" Value="false" />
+    <RuntimeHostConfigurationOption Include="System.Runtime.InteropServices.BuiltInComInterop.IsSupported" Value="false" />
   </ItemGroup>
 </Project>
index 4a927df56cdf68771472c97b56cb7316e66cf930..8511a4c567071e6c6fc8e949e0f4f55c5c02f97a 100644 (file)
@@ -1,4 +1,6 @@
-//using System.Runtime.InteropServices.Tests.Common;
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
 using Xunit;
 
 namespace System.Runtime.InteropServices.Tests