[ComImport]
[Guid("6d5140c1-7436-11ce-8034-00aa006009fa")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IServiceProvider {
void QueryService(ref Guid guidService, ref Guid riid,
[MarshalAs(UnmanagedType.Interface)] out object ppvObject);
}
<ComImport(), _
Guid("6d5140c1-7436-11ce-8034-00aa006009fa"), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Interface IServiceProvider
Sub QueryService(<[In]()> ByVal guidService As Guid, _
<[In]()> ByVal riid As Guid, _
<Out(), MarshalAs(UnmanagedType.Interface)> ByVal ppvObject As Object)
End Interface
None.
The IServiceProvider defined here is different with "System.IServiceProvider". To remove name collisition, rename "IServiceProvider" to other name such as "UCOMIServiceProvider". Otherwise, you should use fully qualified namespace to the interface since you will normally use "using System" directive.