I am building a library which needs to be referenced from VBA so I need to provide a type library to support early binding. Most of the examples I have seen define a interface for classes which are exposed to COM e.g.
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IMyClass
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MyNamespace.MyClass")]
public class MyClass : IMyClass
Is there any disadvantage in having a class implement the interface directly using ClassInterface.AutoDual? For more complex classes I like having interfaces to clearly define which members are exposed com without having to use the ComVisible attribute everywhere. But I will also have a number of fairly trivial data classes like event args which will be exposed to COM in their entirety. I have also seen examples which explicitly set dispids on interfaces - is there any advantage in doing this?