runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Bring System.Runtime.InteropServices up to .NET Standard 2.0

Open danmoseley opened this issue 10 years ago • 9 comments

Below are the list of types that are either missing, changed (eg changed derivation), or have missing members vs .NET Standard 2.0

T:System.Runtime.InteropServices.AssemblyRegistrationFlags
T:System.Runtime.InteropServices.AutomationProxyAttribute
T:System.Runtime.InteropServices.ComAliasNameAttribute
T:System.Runtime.InteropServices.ComCompatibleVersionAttribute
T:System.Runtime.InteropServices.ComConversionLossAttribute
T:System.Runtime.InteropServices.ComRegisterFunctionAttribute
T:System.Runtime.InteropServices.ComUnregisterFunctionAttribute
T:System.Runtime.InteropServices.ExporterEventKind
T:System.Runtime.InteropServices.ExtensibleClassFactory
T:System.Runtime.InteropServices.HandleRef
T:System.Runtime.InteropServices.ICustomFactory
T:System.Runtime.InteropServices.ICustomMarshaler
T:System.Runtime.InteropServices.IDispatchImplAttribute
T:System.Runtime.InteropServices.IDispatchImplType
T:System.Runtime.InteropServices.LCIDConversionAttribute
T:System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute
T:System.Runtime.InteropServices.Marshal
T:System.Runtime.InteropServices.ObjectCreationDelegate
T:System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
T:System.Runtime.InteropServices.ProgIdAttribute
T:System.Runtime.InteropServices.RegistrationClassContext
T:System.Runtime.InteropServices.RegistrationConnectionType
T:System.Runtime.InteropServices.SafeHandle
T:System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute
T:System.Runtime.InteropServices.TYPEKIND
T:System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute
T:System.Runtime.InteropServices.UnmanagedType
T:System.Runtime.InteropServices.Expando.IExpando
T:System.Runtime.InteropServices.WindowsRuntime.DesignerNamespaceResolveEventArgs
T:System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken
T:System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs
T:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata
E:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.DesignerNamespaceResolve
E:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve

a few members of this namespace (such as T:System.Runtime.InteropServices.RuntimeEnvironment) are already covered by https://github.com/dotnet/corefx/issues/11808. Check with @ramarag to make sure everything is covered between you

danmoseley avatar Sep 28 '16 22:09 danmoseley

@ramarag Do any of these above require runtime changes? If so, we should make sure they are on your plate and leave Alex the ones that are framework changes. cc @weshaggard

danmoseley avatar Oct 03 '16 18:10 danmoseley

I did a quick scan through the above list of these only the following seem to need runtime interaction. I can take them into my list

T:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata
E:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.DesignerNamespaceResolve
E:System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve

ramarag avatar Oct 05 '16 02:10 ramarag

Please make sure to compare this list against what is currently in netstandard as we have done some clean-up recently https://github.com/dotnet/standard/pull/44.

weshaggard avatar Oct 06 '16 21:10 weshaggard

@ramarag The following methods also need runtime interaction.

M:System.Runtime.InteropServices.Marshal.BindToMoniker
M:System.Runtime.InteropServices.Marshal.ChangeWrapperHandleStrength

alexperovich avatar Oct 14 '16 18:10 alexperovich

https://github.com/dotnet/corefx/pull/13479

danmoseley avatar Nov 10 '16 18:11 danmoseley

    public abstract class CriticalHandle : CriticalFinalizerObject, IDisposable {
        public void Close();
    }

is not listed above.

danmoseley avatar Nov 10 '16 19:11 danmoseley

These types are in the above list but not is the updated net standard(https://raw.githubusercontent.com/dotnet/standard/master/netstandard/ref/mscorlib.cs):

ExtensibleClassFactory IDispatchImplAttribute IDispatchImplType ObjectCreationDelegate SetWin32ContextInIDispatchAttribute IExpando DesignerNamespaceResolveEventArgs EventRegistrationToken NamespaceResolveEventArgs WindowsRuntimeMetadata DesignerNamespaceResolve ReflectionOnlyNamespaceResolve

Do we need these?

shrah avatar Nov 10 '16 19:11 shrah

As discussed, we don't need anything that's not in https://raw.githubusercontent.com/dotnet/standard/master/netstandard/ref

danmoseley avatar Nov 11 '16 05:11 danmoseley

What package do we need to reference inside a netstandard 2.0 project to have System.Runtime.InteropServices namespace classes recognized? Because by default TypeLibTypeAttribute is not recognized and System.Runtime.InteropServices namespace is not found. Need to reference System.Runtime.InteropServices package? That package dependencies don't state that it supports nestandard 2, see: https://www.nuget.org/packages/System.Runtime.InteropServices/

guylando avatar Jan 13 '19 20:01 guylando