diff options
Diffstat (limited to 'mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs')
-rw-r--r-- | mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs index 0050ff5fee..4cee2f9d98 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectPropertyGroupElement.cs @@ -76,9 +76,15 @@ namespace Microsoft.Build.Construction get { return "PropertyGroup"; } } - internal override ProjectElement LoadChildElement (string name) + internal override ProjectElement LoadChildElement (XmlReader reader) { - return AddProperty (name, null); + switch (reader.LocalName) { + case "ItemGroup": + case "PropertyGroup": + throw CreateError (reader, string.Format ("{0} is a reserved name that cannot be used for a property.", reader.LocalName)); + // others need to be checked too, but things like "Project" are somehow allowed... + } + return AddProperty (reader.LocalName, null); } } } |