Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
imcarolwang committed Oct 24, 2024
1 parent db11dd1 commit 3f52c4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
7 changes: 4 additions & 3 deletions src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public void MakePathsRelativeTo(DirectoryInfo optionsFileDirectory)
var reference = this.References[idx];
if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary)
{
PathHelper.GetRelativePath(reference.FullPath, optionsFileDirectory, out relPath);
this.References[idx].ReferenceIdentity = relPath;
this.References[idx].ReferenceIdentity = PathHelper.GetRelativePath(reference.FullPath, optionsFileDirectory, out relPath) ? relPath : reference.FullPath;
}
}
}
Expand Down Expand Up @@ -134,7 +133,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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3f52c4d

Please sign in to comment.