Compiler Error CS0548
'property' : property or indexer must have at least one accessor
A property must have at least one accessor (get or set) method.
For more information, see and Using Properties.
The following sample generates CS0548.
C#
// CS0548.cs
// compile with: /target:library
public class b
{
public int MyProp {} // CS0548
public int MyProp2 // OK
{
get
{
return 0;
}
set {}
}
}
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: