Compiler Warning (level 1) CS3027
'type_1' is not CLS-compliant because base interface 'type_2' is not CLS-compliant
A non-CLS compliant type cannot be a base type for a type that is CLS compliant.
Example 1
The following sample contains an interface with a method that uses a non-CLS compliant type in its signature, making the type non-CLS compliant.
// CS3027.cs
// compile with: /target:library
public interface IBase
{
void IMethod(uint i);
}
Example 2
The following sample generates CS3027.
// CS3027_b.cs
// compile with: /reference:CS3027.dll /target:library /W:1
[assembly:System.CLSCompliant(true)]
public interface IDerived : IBase {}
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for