string slnVersion = GetSlnFileVersion (reader);
if (slnVersion == "12.00")
-#if XBUILD_12
+#if XBUILD_14
+ p.DefaultToolsVersion = "14.0";
+#elif XBUILD_12
p.DefaultToolsVersion = "12.0";
#else
p.DefaultToolsVersion = "4.0";
if (info != null)
projectInfo.Dependencies [info.Guid] = info;
}
+
+ // unload the project after reading info from it
+ // it'll be reloaded with proper context when building the solution
+ p.ParentEngine.UnloadProject (currentProject);
}
// fill in the project info for deps found in the .sln file
void EmitBeforeImports (Project p, string file)
{
-#if NET_4_0
p.AddNewImport ("$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\SolutionFile\\ImportBefore\\*",
"'$(ImportByWildcardBeforeSolution)' != 'false' and " +
"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\SolutionFile\\ImportBefore')");
-#endif
string before_filename = Path.Combine (Path.GetDirectoryName (file), "before." + Path.GetFileName (file) + ".targets");
p.AddNewImport (before_filename, String.Format ("Exists ('{0}')", before_filename));
void EmitAfterImports (Project p, string file)
{
-#if NET_4_0
p.AddNewImport ("$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\SolutionFile\\ImportAfter\\*",
"'$(ImportByWildcardAfterSolution)' != 'false' and " +
"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\SolutionFile\\ImportAfter')");
-#endif
string after_filename = Path.Combine (Path.GetDirectoryName (file), "after." + Path.GetFileName (file) + ".targets");
p.AddNewImport (after_filename, String.Format ("Exists ('{0}')", after_filename));
if (solutionTarget.Configuration == targetInfo.Key.Configuration &&
solutionTarget.Platform == targetInfo.Key.Platform) {
solutionConfigurationContents.AppendFormat (
- "<ProjectConfiguration Project=\"{0}\">{1}|{2}</ProjectConfiguration>",
- guid.ToString ("B").ToUpper (), targetInfo.Value.Configuration, targetInfo.Value.Platform);
+ "<ProjectConfiguration Project=\"{0}\" AbsolutePath=\"{1}\">{2}|{3}</ProjectConfiguration>",
+ guid.ToString ("B").ToUpper (), projectInfo.FileName, targetInfo.Value.Configuration, targetInfo.Value.Platform);
}
}
}