X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Build%2FMicrosoft.Build.Construction%2FProjectRootElement.cs;h=d7d5d77249b84d51a3addaae52efc374236b95fd;hb=3f3748e9ca993ecd6c6c71f2cb9ac8186670be14;hp=528f30e4bed5c66174fdf22f9f971a3bc3f595fa;hpb=950ca86f454bc78805860131442ac072a890ccea;p=mono.git diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs index 528f30e4bed..d7d5d77249b 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectRootElement.cs @@ -170,7 +170,7 @@ namespace Microsoft.Build.Construction string toolsVersion; public string ToolsVersion { - get { return toolsVersion ?? "4.0"; } + get { return toolsVersion ?? string.Empty; } set { toolsVersion = value; } } @@ -185,6 +185,7 @@ namespace Microsoft.Build.Construction ProjectRootElement (ProjectCollection projectCollection) { + ToolsVersion = "4.0"; } public static ProjectRootElement Create () @@ -217,6 +218,7 @@ namespace Microsoft.Build.Construction public static ProjectRootElement Create (XmlReader xmlReader, ProjectCollection projectCollection) { var result = Create (projectCollection); + result.ToolsVersion = null; result.Load (xmlReader); return result; } @@ -467,6 +469,8 @@ namespace Microsoft.Build.Construction public void Save () { + if (FullPath == null) + throw new InvalidOperationException ("This project was not given the file path to write to."); Save (Encoding); } @@ -538,7 +542,8 @@ namespace Microsoft.Build.Construction AppendChild (def); return def; case "UsingTask": - return AddUsingTask (null, null, null); + var ut = AddUsingTask (null, null, null); + return ut; case "Choose": var choose = CreateChooseElement (); AppendChild (choose);