From 4010c69c7d61223c73f111be2d79c4a440b70b45 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Mon, 28 Feb 2011 16:21:18 +0530 Subject: [PATCH] [xbuild] Make Engine.DefaultToolsVersion 2.0 . Engine.DefaultToolsVersion is used when a project is unable to determine a suitable ToolsVersion to use. Change this fallback version to 2.0 . This allows vs2005 (.net 2.0) projects which don't have ToolsVersion explicitly set, to build. Newer projects set ToolsVersion by default. --- .../Microsoft.Build.BuildEngine/Engine.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs index 8f7bc6d4b7a..239118910a2 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs @@ -518,16 +518,14 @@ namespace Microsoft.Build.BuildEngine { public string DefaultToolsVersion { get { - if (String.IsNullOrEmpty (defaultToolsVersion)) -#if NET_4_0 - return "4.0"; -#elif NET_3_5 - return "3.5"; -#else - return "2.0"; -#endif - - return defaultToolsVersion; + // This is used as the fall back version if the + // project can't find a version to use + // Hard-coded to 2.0, so it allows even vs2005 projects + // to build correctly, as they won't have a ToolsVersion + // set! + return String.IsNullOrEmpty (defaultToolsVersion) + ? "2.0" + : defaultToolsVersion; } set { if (Toolsets [value] == null) -- 2.25.1