Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'interface' interface marked with 'CoClassAttribute' not marked with 'ComImportAttribute'
If you specify CoClassAttribute on an interface, you must also specify ComImportAttribute.
The following sample generates CS0684:
// CS0684.cs
// compile with: /W:1
using System;
using System.Runtime.InteropServices;
[CoClass(typeof(C))] // CS0684
// try the following line instead
// [CoClass(typeof(C)), ComImport]
interface I
{
}
class C
{
static void Main() {}
}