Skip to content
Permalink
Browse files

VSIX: LoadProjectFromReferenceCommand fails to match references

  • Loading branch information...
apobekiaris committed Aug 7, 2019
1 parent 6a7d8cd commit a50b8953c8521e3547512ac7485e736cfeabcf8e
Showing with 4 additions and 3 deletions.
  1. +4 −3 Xpand.Plugins/Xpand.VSIX/Commands/LoadProjectFromReferenceCommand.cs
@@ -2,6 +2,7 @@
using System.ComponentModel.Design;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using EnvDTE;
@@ -76,13 +77,13 @@ public class LoadProjectFromReferenceCommand:VSCommand{
references = objects.Select(o => vsProject.References.Cast<object>().First(_ => (string) _.GetPropertyValue("Name")==(string) o.GetPropertyValue("Name"))).ToArray();
}

foreach (var reference in references){
var path = GetPath(reference);
foreach (var reference in references) {
var path = Regex.Replace(GetPath(reference), @"(\\{2,})", @"\");
DTE.WriteToOutput($"Looking for ${path}");
var projectInfo = OptionClass.Instance.SourceCodeInfos.SelectMany(info => info.ProjectPaths)
.FirstOrDefault(
info =>
string.Equals(info.OutputPath, path, StringComparison.CurrentCultureIgnoreCase) &&
string.Equals(Regex.Replace(info.OutputPath, @"(\\{2,})", @"\"), path, StringComparison.CurrentCultureIgnoreCase) &&
AssemblyDefinition.ReadAssembly(info.OutputPath).VersionMatch());
var name = GetName(reference);
if (projectInfo != null){

0 comments on commit a50b895

Please sign in to comment.
You can’t perform that action at this time.