From c21b1d1cbf8706c6190c56d7c81780bcd45691e7 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 7 Jun 2012 09:45:24 +0200 Subject: [PATCH] Fixed issue that could cause projects to be initially parsed in the wrong configuration. --- .../Project/Src/Project/Solution/Solution.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index 52bf8e93be..7fcac06c00 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -672,12 +672,16 @@ namespace ICSharpCode.SharpDevelop.Project return newSec; } - public SolutionItem GetProjectConfiguration(string guid) { - ProjectSection projectConfigSection = GetProjectConfigurationsSection(); - SolutionItem foundItem = projectConfigSection.Items.Find(item => item.Name.StartsWith(guid)); - if (foundItem != null) - return foundItem; - LoggingService.Warn("No configuration for project "+guid + "using default."); + SolutionItem GetProjectConfiguration(string guid) + { + ProjectSection prjSec = GetProjectConfigurationsSection(); + string searchKey = guid + "." + preferences.ActiveConfiguration + "|" + preferences.ActivePlatform + ".ActiveCfg"; + foreach (SolutionItem item in prjSec.Items) { + if (searchKey.Equals(item.Name, StringComparison.OrdinalIgnoreCase)) { + return item; + } + } + LoggingService.Warn("No configuration for project " + guid + "; using default."); return new SolutionItem("Debug|Any CPU", "Debug|Any CPU"); }