Skip to content

Commit 3f52c4d

Browse files
committed
update.
1 parent db11dd1 commit 3f52c4d

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,7 @@ private async Task ProcessReferencesOptionAsync(CancellationToken cancellationTo
627627
{
628628
for (int idx = this.References.Count - 1; idx >= 0; idx--)
629629
{
630-
var selected = references.Where(x => string.Equals(this.References[idx].Name, x.Name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
631-
if (selected != null)
632-
{
633-
this.References[idx] = selected;
634-
}
635-
else
630+
if (!references.Contains(this.References[idx]))
636631
{
637632
this.References.RemoveAt(idx);
638633
}

src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ public void MakePathsRelativeTo(DirectoryInfo optionsFileDirectory)
104104
var reference = this.References[idx];
105105
if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary)
106106
{
107-
PathHelper.GetRelativePath(reference.FullPath, optionsFileDirectory, out relPath);
108-
this.References[idx].ReferenceIdentity = relPath;
107+
this.References[idx].ReferenceIdentity = PathHelper.GetRelativePath(reference.FullPath, optionsFileDirectory, out relPath) ? relPath : reference.FullPath;
109108
}
110109
}
111110
}
@@ -134,7 +133,9 @@ public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory)
134133
var reference = this.References[idx];
135134
if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary)
136135
{
137-
this.References[idx].FullPath = Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity);
136+
string fullPath = Path.GetFullPath(Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity));
137+
this.References[idx].FullPath = fullPath;
138+
this.References[idx].ReferenceIdentity = fullPath;
138139
}
139140
}
140141
}

src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private ProjectDependency(string filePath = "", string packageName = "", string
153153

154154
this.ReferenceIdentity = this.DependencyType == ProjectDependencyType.Package || this.DependencyType == ProjectDependencyType.Tool || !string.IsNullOrWhiteSpace(packageName) ?
155155
string.Format(CultureInfo.InvariantCulture, "{0}, {{{1}, {2}}}", this.AssemblyName, this.Name, this.Version) :
156-
this.FullPath;
156+
filePath;
157157

158158
this.IsFramework = this.Name == NetCoreAppPackageID || this.Name == NetStandardLibraryPackageID;
159159
}

0 commit comments

Comments
 (0)