編譯器警告 (層級 1) CS3027
更新:2007 年 11 月
錯誤訊息
'type_1' 不符合 CLS 標準,因為基底介面 'type_2' 不符合 CLS 標準
不符合 CLS 標準的型別不能當做符合 CLS 標準之型別的基底型別。
範例
下列範例包含了具有方法的介面,該方法在其簽章中使用了不符合 CLS 標準的型別,因而讓此型別變成不符合 CLS 標準。
// CS3027.cs
// compile with: /target:library
public interface IBase
{
void IMethod(uint i);
}
下列範例會產生 CS3027:
// CS3027_b.cs
// compile with: /reference:CS3027.dll /target:library /W:1
[assembly:System.CLSCompliant(true)]
public interface IDerived : IBase {}