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.
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) {}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: