System.Runtime.InteropServices.WindowsRuntime.DefaultInterfaceAttribute Class

Specifies the default interface of a managed wrt class.

See Also: DefaultInterfaceAttribute Members


[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)]
public sealed class DefaultInterfaceAttribute : Attribute


When you develop wrt Components, use this attribute when you want to specify the default interface that is used to marshal the class the attribute is applied to. This is not necessary if you allow the class interfaces to be generated automatically.

A wrt class must have a default interface. If the WinMdExp.exe utility does not detect a default interface for a class when it builds your wrt component, it chooses an interface as follows:

You can apply the System.Runtime.InteropServices.WindowsRuntime.DefaultInterfaceAttribute attribute to the class, or apply the Windows.Foundations.Metadata.DefaultAttribute attribute to an interface. The latter takes precedence if both attributes are supplied.


Namespace: System.Runtime.InteropServices.WindowsRuntime
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: