diff --git a/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs b/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs index b1c5781515d..fba627672f9 100644 --- a/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs +++ b/src/dotnet-svcutil/lib/src/Shared/Options/UpdateOptions.cs @@ -97,6 +97,17 @@ public void MakePathsRelativeTo(DirectoryInfo optionsFileDirectory) this.Inputs[idx] = new Uri(relPath, UriKind.Relative); } } + + // Update references + for (int idx = 0; idx < this.References.Count; idx++) + { + 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; + } + } } public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory) @@ -116,6 +127,16 @@ public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory) this.Inputs[idx] = fileUri; } } + + // Update references full path + for (int idx = 0; idx < this.References.Count; idx++) + { + var reference = this.References[idx]; + if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary) + { + this.References[idx].FullPath = Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity); + } + } } } } diff --git a/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs b/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs index e408ea2251c..886a4107ac8 100644 --- a/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs +++ b/src/dotnet-svcutil/lib/src/Shared/ProjectDependency.cs @@ -43,7 +43,7 @@ internal class ProjectDependency : IComparable /// /// Assembly full path. /// - public string FullPath { get; private set; } + public string FullPath { get; set; } /// /// Assembly name. @@ -63,7 +63,7 @@ internal class ProjectDependency : IComparable /// /// The package identity, used for describing the dependency passed to Svcutil. /// - public string ReferenceIdentity { get; private set; } + public string ReferenceIdentity { get; set; } #region instance contruction methods // this ctr is private to ensure the integrity of the data which can be done only by the provided static instance creation (FromXXX) methods. @@ -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) : - string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.AssemblyName, this.Version); + FullPath; this.IsFramework = this.Name == NetCoreAppPackageID || this.Name == NetStandardLibraryPackageID; }