Avviso del compilatore (livello 1) CS3027

Aggiornamento: novembre 2007

Messaggio di errore

'tipo_1' non è compatibile con CLS perché l'interfaccia base 'tipo_2' non è compatibile con CLS
'type_1' is not CLS-compliant because base interface 'type_2' is not CLS-compliant

Un tipo non compatibile con CLS non può essere un tipo base per un tipo compatibile con CLS.

Esempio

Nell'esempio seguente viene riportata un'interfaccia con un metodo che utilizza un tipo non compatibile con CLS nella firma, rendendo il tipo non compatibile con CLS.

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

Il seguente codice di esempio genera l'errore CS3027.

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