Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/dotnet-svcutil/lib/src/CommandProcessorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,21 +619,33 @@ private async Task ProcessReferencesOptionAsync(CancellationToken cancellationTo
await logger.WriteMessageAsync(Shared.Resources.ResolvingProjectReferences, logToUI: this.ToolContext <= OperationalContext.Global).ConfigureAwait(false);

var references = await this.Project.ResolveProjectReferencesAsync(ProjectDependency.IgnorableDependencies, logger, cancellationToken).ConfigureAwait(false);
var projectDependencies = references.ToList();

ToolConsole.WriteLine($"TypeReuseMode: {TypeReuseMode}");
if (this.TypeReuseMode == Svcutil.TypeReuseMode.All)
{
this.References.Clear();
this.References.AddRange(references);
this.References.AddRange(projectDependencies);
}
else // Update operation: remove any reference no longer in the project!
else
{
// Update operation: remove any reference no longer in the project!
for (int idx = this.References.Count - 1; idx >= 0; idx--)
{
if (!references.Contains(this.References[idx]))
if (!projectDependencies.Contains(this.References[idx]))
{
this.References.RemoveAt(idx);
}
}

// Add any new references that are not already in the list.
foreach (var missingReference in projectDependencies)
{
if (!this.References.Contains(missingReference))
{
this.References.Add(missingReference);
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ private CodeTypeReference GetReferencedType(DataContract dataContract)
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.TypeMustBeIXmlSerializable, DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable), dataContract.StableName.Name, dataContract.StableName.Namespace)));
}
DataContract referencedContract = _dataContractSet.GetDataContract(type);
if (referencedContract.Equals(dataContract))
if (referencedContract.StableName.Equals(dataContract.StableName))
{
typeReference = GetCodeTypeReference(type);
typeReference.UserData.Add(s_codeUserDataActualTypeKey, type);
Expand Down
Loading