共用方式為


編譯器錯誤 CS1724

更新:2007 年 11 月

錯誤訊息

為 'System.Runtime.InteropServices.DefaultCharSetAttribute' 指定的引數值無效

這是由 DefaultCharSetAttribute 類別的無效引數所產生的錯誤。

範例

下列範例會產生 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() {}
}