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.
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)