Compiler Error CS0074
'event': abstract event cannot have initializer
If an event is marked as abstract, it cannot be initialized. For more information, see Events.
The following sample generates CS0074:
// CS0074.cs
delegate void D();
abstract class Test
{
public abstract event D e = null; // CS0074
// try the following line instead
// public abstract event D e;
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: