Freigeben über


Compilerwarnung (Stufe 1) CS3027

Aktualisiert: November 2007

Fehlermeldung

"type_1" ist nicht CLS-kompatibel, da die Basisschnittstelle "type_2" nicht CLS-kompatibel ist
'type_1' is not CLS-compliant because base interface 'type_2' is not CLS-compliant

Ein nicht CLS-kompatibler Typ kann kein Basistyp für einen Typ sein, der CLS-kompatibel ist.

Beispiel

Das folgende Beispiel enthält eine Schnittstelle mit einer Methode, in deren Signatur ein nicht CLS-kompatibler Typ verwendet wird, wodurch der Typ nicht CLS-kompatibel wird.

// CS3027.cs
// compile with: /target:library
public interface IBase
{
   void IMethod(uint i);
}

Im folgenden Beispiel wird CS3027 generiert.

// CS3027_b.cs
// compile with: /reference:CS3027.dll /target:library /W:1
[assembly:System.CLSCompliant(true)]
public interface IDerived : IBase {}