Skip to content

Commit d1c3b3e

Browse files
committed
update fix.
1 parent 11e215c commit d1c3b3e

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

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

+21
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ public void MakePathsRelativeTo(DirectoryInfo optionsFileDirectory)
9797
this.Inputs[idx] = new Uri(relPath, UriKind.Relative);
9898
}
9999
}
100+
101+
// Update references
102+
for (int idx = 0; idx < this.References.Count; idx++)
103+
{
104+
var reference = this.References[idx];
105+
if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary)
106+
{
107+
PathHelper.GetRelativePath(reference.FullPath, optionsFileDirectory, out relPath);
108+
this.References[idx].ReferenceIdentity = relPath;
109+
}
110+
}
100111
}
101112

102113
public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory)
@@ -116,6 +127,16 @@ public void ResolveFullPathsFrom(DirectoryInfo optionsFileDirectory)
116127
this.Inputs[idx] = fileUri;
117128
}
118129
}
130+
131+
// Update references full path
132+
for (int idx = 0; idx < this.References.Count; idx++)
133+
{
134+
var reference = this.References[idx];
135+
if (reference.DependencyType == ProjectDependencyType.Project || reference.DependencyType == ProjectDependencyType.Binary)
136+
{
137+
this.References[idx].FullPath = Path.Combine(optionsFileDirectory.FullName, reference.ReferenceIdentity);
138+
}
139+
}
119140
}
120141
}
121142
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ internal class ProjectDependency : IComparable<ProjectDependency>
4343
/// <summary>
4444
/// Assembly full path.
4545
/// </summary>
46-
public string FullPath { get; private set; }
46+
public string FullPath { get; set; }
4747

4848
/// <summary>
4949
/// Assembly name.
@@ -63,7 +63,7 @@ internal class ProjectDependency : IComparable<ProjectDependency>
6363
/// <summary>
6464
/// The package identity, used for describing the dependency passed to Svcutil.
6565
/// </summary>
66-
public string ReferenceIdentity { get; private set; }
66+
public string ReferenceIdentity { get; set; }
6767

6868
#region instance contruction methods
6969
// 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
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-
string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.AssemblyName, this.Version);
156+
FullPath;
157157

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

0 commit comments

Comments
 (0)