编译器错误 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() {}
}