Partager via


Erreur du compilateur CS1910

Mise à jour : novembre 2007

Message d'erreur

L'argument de type 'type' n'est pas applicable pour l'attribut DefaultValue
Argument of type 'type' is not applicable for the DefaultValue attribute

Pour les paramètres dont le type est objet, l'argument de DefaultParameterValueAttribute doit être null, un type intégral, une virgule flottante, bool, string, enum ou char. L'argument ne peut pas être de type Type ou un type de tableau.

Exemple

L'exemple suivant génère l'erreur CS1910.

// CS1910.cs
// compile with: /target:library
using System.Runtime.InteropServices;

public interface MyI
{
   void Test([DefaultParameterValue(typeof(object))] object o);   // CS1910
}