Edit

Share via


Compiler Warning (level 1) CS3015

'method signature' has no accessible constructors which use only CLS-compliant types

To be compliant with the Common Language Specification (CLS), the argument list of an attribute class cannot contain an array. For more information on CLS compliance, see Language independence and language-independent components.

Example

The following sample generates 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) {}  
}