NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS0635

'attribute' : System.Interop.UnmanagedType.CustomMarshaller requires named arguments ComType and Marshal

The ComType and Marshal arguments must be specified when the marshal format is System.Interop.UnmanagedType.CustomMarshaller.

The following sample generates CS0635:

class MyCustomMarshallerClass {  
}

public class MyClass {
   [dllimport("MyDll.dll")]
   public static extern void MyFunc(
   [marshal(System.Interop.UnmanagedType.CustomMarshaler]   // CS0635
   
   // try the following lines instead
   // [marshal(System.Interop.UnmanagedType.CustomMarshaler, ComType="MyProgId", 
   // Marshaller=typeof(MyCustomMarshallerClass))]

      object o);
   
   public static void Main() {
   }
}