This documentation is archived and is not being maintained.

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 Writing CLS-Compliant Code and Common Language Specification.

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) {}
}
Show: