我在AC#類庫下面的代碼...使用枚舉是不符合CLS
public static class foo
{
public enum bar
{
bsNone = -1,
bsSolid = 0,
bsDash = 1
}
}
而且在VB.Net WinForms應用程序我引用枚舉的屬性的返回類型:
Private _LeftBorderStyle As foo.bar
Public Property LeftBorderStyle() As foo.bar
Get
Return _LeftBorderStyle
End Get
Set(ByVal value As foo.bar)
_LeftBorderStyle = value
End Set
End Property
當我建立VB.Net項目我得到以下警告:
Return type of function 'LeftBorderStyle' is not CLS-compliant.
你能告訴我爲什麼枚舉是不符合CLS的?
是否將類庫標記爲符合CLS?如果沒有,你會得到這個警告。 –
[參數類型不符合CLS,爲什麼?](http://stackoverflow.com/questions/3475726/argument-type-is-not-cls-compliant-why) – Backs
不,但我不明白爲什麼類中的其他4000行代碼不是給我CLS合規警告?只有枚舉? –