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
6 changes: 6 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<PropertyGroup>
<MicrosoftApplicationInsightsPackageVersion>2.20.0</MicrosoftApplicationInsightsPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>$(DotNetRuntimeRcVersion)</MicrosoftExtensionsDependencyModelPackageVersion>
<!--
Keep System.CodeDom compatible with the oldest supported runtime for dotnet-svcutil.
Newer System.CodeDom builds (e.g., net10-rc aligned) can reference framework assemblies
that don't exist on .NET 8 at runtime (e.g., System.ComponentModel.Primitives v9.0.0.0).
-->
<SystemCodeDomPackageVersion>8.0.0</SystemCodeDomPackageVersion>
<NuGetProjectModelPackageVersion>6.14.0</NuGetProjectModelPackageVersion>
<NuGetVersioningPackageVersion>6.14.0</NuGetVersioningPackageVersion>
<SystemReflectionEmitPackageVersion>4.7.0</SystemReflectionEmitPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using Microsoft.CodeDom.Compiler;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-svcutil/lib/src/CodeDomFixup/CodeDomHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.ServiceModel;
using System.Threading.Tasks;
using System.Linq;
Expand Down Expand Up @@ -68,10 +68,10 @@ private CodeMemberMethod GenerateTaskBasedAsyncMethod(string methodName, NameSco
if (methodName.Equals("Close"))
{
string condition = _isVisualBasic ? "Not NET6_0_OR_GREATER" : "!NET6_0_OR_GREATER";
CodeIfDirective ifStart = new CodeIfDirective(CodeIfMode.Start, condition);
CodeIfDirective ifEnd = new CodeIfDirective(CodeIfMode.End, "");
implMethod.StartDirectives.Add(ifStart);
implMethod.EndDirectives.Add(ifEnd);
// System.CodeDom doesn't provide a CodeIfDirectiveStatement; we use a region directive as a stable marker
// and post-process the generated text to convert it into the desired conditional compilation directives.
Comment thread
imcarolwang marked this conversation as resolved.
implMethod.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "SVCUTIL_CLOSEASYNC_WRAP:" + condition));
implMethod.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, string.Empty));
}

return implMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using System.Diagnostics.CodeAnalysis;
using System.ServiceModel;
using System.ServiceModel.Description;
using Microsoft.CodeDom;
using Microsoft.CodeDom.Compiler;
using System.CodeDom;
using System.CodeDom.Compiler;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;
using System.ServiceModel;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.ServiceModel.Description;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.ServiceModel;
using System.ServiceModel.Channels;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
internal class NamespaceFixup : CodeDomVisitor
{
private static string s_microsoftXml = "Microsoft.Xml";
private static string s_systemXml = "System.Xml";
private static string s_microsoftCodeDom = "Microsoft.CodeDom";
private static string s_systemCodeDom = "System.CodeDom";
private Dictionary<string, Type> _xmlTypes = new Dictionary<string, Type>();
private Dictionary<string, Type> _codeDomTypes = new Dictionary<string, Type>();

public NamespaceFixup()
{
Expand All @@ -29,17 +26,6 @@ public NamespaceFixup()
_xmlTypes[type.FullName] = type;
}
}

// Microsoft.CodeDom
var mscodedomTypes = TypeLoader.LoadTypes(typeof(Microsoft.CodeDom.CodeObject).GetTypeInfo().Assembly, Verbosity.Silent);

foreach (var type in mscodedomTypes)
{
if (type.FullName.Contains(s_microsoftCodeDom))
{
_codeDomTypes[type.FullName] = type;
}
}
}

protected override void Visit(CodeAttributeDeclaration attr)
Expand All @@ -49,10 +35,6 @@ protected override void Visit(CodeAttributeDeclaration attr)
{
attr.Name = attr.Name.Replace(s_microsoftXml, s_systemXml);
}
if (attr.Name.Contains(s_microsoftCodeDom) && _codeDomTypes.ContainsKey(attr.Name))
{
attr.Name = attr.Name.Replace(s_microsoftCodeDom, s_systemCodeDom);
}
}

protected override void Visit(CodeComment comment)
Expand All @@ -62,10 +44,6 @@ protected override void Visit(CodeComment comment)
{
comment.Text = comment.Text.Replace(s_microsoftXml, s_systemXml);
}
if (comment.Text.Contains(s_microsoftCodeDom) && _codeDomTypes.ContainsKey(comment.Text))
{
comment.Text = comment.Text.Replace(s_microsoftCodeDom, s_systemCodeDom);
}
}

protected override void Visit(CodeTypeReference typeref)
Expand All @@ -75,10 +53,6 @@ protected override void Visit(CodeTypeReference typeref)
{
typeref.BaseType = typeref.BaseType.Replace(s_microsoftXml, s_systemXml);
}
if (typeref.BaseType.Contains(s_microsoftCodeDom) && _codeDomTypes.ContainsKey(typeref.BaseType))
{
typeref.BaseType = typeref.BaseType.Replace(s_microsoftCodeDom, s_systemCodeDom);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Microsoft.Tools.ServiceModel.Svcutil
{
using Microsoft.CodeDom;
using System.CodeDom;

internal class RemoveAsyncMethodsFromClientClass : ClientClassVisitor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;
using System.ServiceModel;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Microsoft.Tools.ServiceModel.Svcutil
{
using Microsoft.CodeDom;
using System.CodeDom;

internal class RemoveSyncMethodsFromClientClass : ClientClassVisitor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;
using System.ServiceModel;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;

namespace Microsoft.Tools.ServiceModel.Svcutil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Collections.Generic;
using System.ServiceModel.Description;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-svcutil/lib/src/CodeDomFixup/ConfigToCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Collections.ObjectModel;
using System.ServiceModel;
using System.ServiceModel.Description;
using Microsoft.CodeDom;
using System.CodeDom;

namespace Microsoft.Tools.ServiceModel.Svcutil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeDom;
using System.CodeDom;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
Expand Down
Loading
Loading