Avertissement du compilateur (niveau 1) CS3003

Type de « variable » non conforme CLS

Une variable public, protected ou protected internal doit avoir un type conforme à la spécification CLS (Common Language Specification). Pour plus d’informations sur la conformité CLS, consultez Indépendance du langage et composants indépendants du langage.

Exemple

L’exemple suivant génère l’erreur CS3003 :

// CS3003.cs  
  
[assembly:System.CLSCompliant(true)]  
public class a  
{  
    public ushort a1;   // CS3003, public variable  
    public static void Main()  
    {  
    }  
}