此浏览器不再受支持。
请升级到 Microsoft Edge 以使用最新的功能、安全更新和技术支持。
更新:2007 年 11 月
“property”:属性或索引器不能有 void 类型
void 作为属性的返回值无效。
有关更多信息,请参见属性。
下面的示例生成 CS0547:
// CS0547.cs public class a { public void i // CS0547 // Try the following declaration instead: // public int i { get { return 0; } } } public class b : a { public static void Main() { } }