更新:2007 年 11 月
错误消息
“accessor”添加了接口成员“property”中没有的访问器
派生类中属性的实现包含未在基接口中指定的访问器。
有关更多信息,请参见使用属性(C# 编程指南)。
示例
下面的示例生成 CS0550。
// CS0550.cs
namespace x
{
interface ii
{
int i
{
get;
// add the following accessor to resolve this CS0550
// set;
}
}
public class a : ii
{
int ii.i
{
get
{
return 0;
}
set {} // CS0550 no set in interface
}
public static void Main() {}
}
}