Compiler Warning (level 1) CS3011
'member': only CLS-compliant members can be abstract
A class member cannot be both abstract and non-compliant with the Common Language Specification (CLS). The CLS specifies that all class members shall be implemented. For more information about CLS compliance, see Language independence and language-independent components.
The following example generates CS3011:
// CS3011.cs
using System;
[assembly:CLSCompliant(true)]
public abstract class I
{
[CLSCompliant(false)]
public abstract int M(); // CS3011
// OK
[CLSCompliant(false)]
public void M2()
{
}
}
public class C : I
{
public override int M()
{
return 1;
}
public static void Main()
{
}
}
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: