共用方式為


編譯器警告 (層級 1) CS3015

更新:2007 年 11 月

錯誤訊息

'method signature' 沒有僅使用符合 CLS 標準之型別的可存取建構函式

為了要能夠符合 Common Language Specification (CLS) 標準,屬性類別的引數清單不可以包含陣列。如需 CLS 標準符合性的詳細資訊,請參閱撰寫符合 CLS 標準的程式碼Common Language Specification

範例

下列範例會產生 C3015:

// CS3015.cs
// compile with: /target:library
using System;

[assembly:CLSCompliant(true)]
public class MyAttribute : Attribute
{
   public MyAttribute(int[] ai) {}   // CS3015
   // try the following line instead
   // public MyAttribute(int ai) {}
}