Errore del compilatore CS1724

Aggiornamento: novembre 2007

Messaggio di errore

Il valore specificato per l'argomento di 'System.Runtime.InteropServices.DefaultCharSetAttribute' non è valido
Value specified for the argument to 'System.Runtime.InteropServices.DefaultCharSetAttribute' is not valid

Questo errore viene generato da un argomento non valido della classe DefaultCharSetAttribute.

Esempio

Nell'esempio viene generato l'errore CS1724.

// CS1724.cs
using System.Runtime.InteropServices;
// To resolve, replace 42 with a valid CharSet value.
 [module:DefaultCharSetAttribute((CharSet)42)]   // CS1724
class C { 

[DllImport("F.Dll")]
extern static void FW1Named();

static void Main() {}
}