diff --git a/MvsSln/Core/IXProject.cs b/MvsSln/Core/IXProject.cs
index 14856ef..882a17e 100644
--- a/MvsSln/Core/IXProject.cs
+++ b/MvsSln/Core/IXProject.cs
@@ -252,6 +252,13 @@ public interface IXProject
///
string GetRelativePath(string path);
+ ///
+ /// Makes full path using path to this project as the base.
+ ///
+ /// any path relative to the current project.
+ ///
+ string GetFullPath(string relative);
+
///
/// Adds 'Reference' item.
///
diff --git a/MvsSln/Core/ProjectReferences.cs b/MvsSln/Core/ProjectReferences.cs
index b64f011..6467491 100644
--- a/MvsSln/Core/ProjectReferences.cs
+++ b/MvsSln/Core/ProjectReferences.cs
@@ -25,6 +25,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using net.r_eg.MvsSln.Core.SlnHandlers;
using net.r_eg.MvsSln.Extensions;
using net.r_eg.MvsSln.Projects;
@@ -111,9 +112,20 @@ protected void InitMap()
if(!map.ContainsKey(r.Key)) {
map[r.Key] = new HashSet();
}
- r.Value.ForEach(i => map[r.Key].Add(FormatGuid(i.meta["Project"].evaluated)));
+ r.Value.ForEach(i => ExtarctProjectGuid(i)?.E(g => map[r.Key].Add(FormatGuid(g))));
}
BuildOrder();
}
+
+ private string ExtarctProjectGuid(Item item)
+ {
+ const string _PK = "Project";
+ if(item.meta.ContainsKey(_PK)) return item.meta[_PK].evaluated;
+
+ return XProjects.FirstOrDefault(
+ p => p.ProjectItem.project.fullPath == p.GetFullPath(item.evaluatedInclude)
+ )?
+ .ProjectGuid;
+ }
}
}
\ No newline at end of file
diff --git a/MvsSln/Core/XProject.cs b/MvsSln/Core/XProject.cs
index ad9ab14..707ab40 100644
--- a/MvsSln/Core/XProject.cs
+++ b/MvsSln/Core/XProject.cs
@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -467,6 +468,13 @@ public IEnumerable GetProperties()
///
public virtual string GetRelativePath(string path) => RootPath.MakeRelativePath(path);
+ ///
+ /// Makes full path using path to this project as the base.
+ ///
+ /// any not null path relative to the current project.
+ ///
+ public string GetFullPath(string relative) => Path.GetFullPath(Path.Combine(RootPath, relative));
+
///
/// Adds 'Reference' item.
///
diff --git a/MvsSln/Extensions/ObjectExtension.cs b/MvsSln/Extensions/ObjectExtension.cs
index 173b41b..a2767bc 100644
--- a/MvsSln/Extensions/ObjectExtension.cs
+++ b/MvsSln/Extensions/ObjectExtension.cs
@@ -30,28 +30,25 @@ namespace net.r_eg.MvsSln.Extensions
public static class ObjectExtension
{
///
- /// Execute action separately from result.
+ /// Execute action on value in the chain separately from result.
///
- /// The type of value that should be returned.
- /// Unspecified object.
- /// Any action that should be executed.
- /// Same value from selected object as T type.
- public static T E(this object obj, Action act)
- {
- act();
- return (T)obj;
- }
+ ///
+ ///
+ ///
+ /// Input value.
+ public static T E(this T obj, Action act) => E(obj, _=> act());
///
- /// Execute action separately from result.
- /// Alias to `E<object>()`
+ /// Execute action on value in the chain separately from result.
///
- /// Unspecified object.
- /// Any action that should be executed.
- /// Same value from selected object.
- public static object E(this object obj, Action act)
+ ///
+ ///
+ ///
+ /// Input value.
+ public static T E(this T obj, Action act)
{
- return E