Compiler Error CS0541
'declaration' : explicit interface declaration can only be declared in a class or struct
An explicit interface declaration was found outside a class or struct.
The following sample generates CS0541:
// CS0541.cs
namespace x
{
interface IFace
{
void F();
}
interface IFace2 : IFace
{
void IFace.F(); // CS0541
}
}
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: