【发布时间】:2017-10-23 21:03:27
【问题描述】:
我在尝试编译通过 svcutil 生成的代理类时遇到了上述错误。这是问题的简短版本:
class A
{
private string colorField;
private string set_colorField;
public string color
{
get
{
return this.colorField;
}
set
{
this.colorField = value;
}
}
public string set_color
{
get
{
return this.set_colorField;
}
set
{
this.set_colorField = value;
}
}
}
这编译得很好:
public string Color
{
get;set;
}
public string Set_Color
{
get;set;
}
但这会引发同样的错误:
public string color
{
get;set;
}
public string set_color
{
get;set;
}
我不记得曾经阅读过有关此限制的信息。有人可以指出 C# 编译器规范的相关部分吗?
【问题讨论】:
-
@Kirk 我明白这一点,但是 c# 编译器规范中提到此限制的相关部分在哪里?我找不到它:/