aviso do compilador (nível 1) CS0684

Mensagem de erro

interface de 'interface' marcada com 'CoClassAttribute' não são marcado com 'ComImportAttribute'

Se você especificar CoClassAttribute em uma interface, você também deve especificar ComImportAttribute.

O exemplo a seguir gera 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() {}
}