+ if (String.IsNullOrEmpty (solutionConfigurationContents))
+ return true;
+
+ XmlReader xr = null;
+ guidToConfigPlatform = new Dictionary<Guid, string> ();
+ absolutePathToConfigPlatform = new Dictionary<string, string> ();
+ try {
+ xr = XmlReader.Create (new StringReader (solutionConfigurationContents));
+
+ xr.Read ();
+ while (!xr.EOF) {
+ xr.Read ();
+ if (xr.NodeType != XmlNodeType.Element)
+ continue;
+
+ string guid_str = xr.GetAttribute ("Project");
+ string abs_path = xr.GetAttribute ("AbsolutePath");
+ string config_str = xr.ReadString ();
+
+ if (String.IsNullOrEmpty (config_str))
+ continue;
+
+ Guid guid;
+ if (TryParseGuid (guid_str, out guid))
+ guidToConfigPlatform [guid] = config_str;
+
+ if (!String.IsNullOrEmpty (abs_path)) {
+ abs_path = Path.GetFullPath (abs_path);
+ absolutePathToConfigPlatform [abs_path] = config_str;
+ }
+ }
+ } catch (XmlException xe) {
+ Log.LogError ("XmlException while parsing SolutionConfigurationContents: {0}",
+ xe.ToString ());
+
+ return false;
+ } finally {
+ ((IDisposable)xr).Dispose ();
+ }
+
+ List<ITaskItem> tempAssignedProjects = new List<ITaskItem> ();
+ List<ITaskItem> tempUnassignedProjects = new List<ITaskItem> ();
+ foreach (ITaskItem item in ProjectReferences) {
+ string config = GetConfigPlatformFromProjectReference (item);
+
+ if (String.IsNullOrEmpty (config)) {
+ tempUnassignedProjects.Add (item);
+ continue;
+ }
+
+ string [] parts = config.Split (new char [] {'|'}, 2);
+
+ ITaskItem new_item = new TaskItem (item);
+
+ new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
+ new_item.SetMetadata ("SetPlatform", "Platform=" +
+ ((parts.Length > 1) ? parts [1] : String.Empty));
+
+ tempAssignedProjects.Add (new_item);
+ }
+
+ assignedProjects = tempAssignedProjects.ToArray ();
+ unassignedProjects = tempUnassignedProjects.ToArray ();
+
+ return true;