From 9c7c50363ae96f941323f93fc648299adb7b9755 Mon Sep 17 00:00:00 2001 From: Carol Wang Date: Mon, 21 Oct 2024 13:39:10 +0800 Subject: [PATCH] update. --- src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs | 7 +------ src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs | 4 +++- src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs b/src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs index 41c8478c2f6..f9b7b294b08 100644 --- a/src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs +++ b/src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs @@ -627,12 +627,7 @@ private async Task ProcessReferencesOptionAsync(CancellationToken cancellationTo { for (int idx = this.References.Count - 1; idx >= 0; idx--) { - var selected = references.Where(x => string.Equals(this.References[idx].Name, x.Name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - if (selected != null) - { - this.References[idx] = selected; - } - else + if (!references.Contains(this.References[idx])) { this.References.RemoveAt(idx); } diff --git a/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs b/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs index fba627672f9..2d457ccf3e7 100644 --- a/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs +++ b/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs @@ -134,7 +134,9 @@ public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory) var reference = this.References[idx]; if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary) { - this.References[idx].FullPath = Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity); + string fullPath = Path.GetFullPath(Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity)); + this.References[idx].FullPath = fullPath; + this.References[idx].ReferenceIdentity = fullPath; } } } diff --git a/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs b/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs index c484da3899e..4ba6b138400 100644 --- a/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs +++ b/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs @@ -153,7 +153,7 @@ private ProjectDependency(string filePath = "", string packageName = "", string this.ReferenceIdentity = this.DependencyType == ProjectDependencyType.Package || this.DependencyType == ProjectDependencyType.Tool || !string.IsNullOrWhiteSpace(packageName) ? string.Format(CultureInfo.InvariantCulture, "{0}, {{{1}, {2}}}", this.AssemblyName, this.Name, this.Version) : - this.FullPath; + filePath; this.IsFramework = this.Name == NetCoreAppPackageID || this.Name == NetStandardLibraryPackageID; }