更新:2007 年 11 月
错误消息
“method”的返回类型不符合 CLS
示例
下面的示例生成 CS3002:
// CS3002.cs
[assembly:System.CLSCompliant(true)]
public class a
{
    public ushort bad()   // CS3002, public method
    {
        ushort a;
        a = ushort.MaxValue;
        return a;
    }
    private ushort OK()   // OK, private method
    {
        ushort a;
        a = ushort.MaxValue;
        return a;
    }
    public static void Main()
    {
    }
} | |