Skip to content

dotnet-svcutil test: fix ParamsFiles and typereuse cases #5052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/dotnet-svcutil/lib/src/Shared/TargetFrameworkHelper.cs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ namespace Microsoft.Tools.ServiceModel.Svcutil
{
internal class TargetFrameworkHelper
{
internal static readonly List<string> s_currentSupportedVersions = new List<string>() { "8.0", "9.0" };
internal static readonly List<string> s_currentSupportedVersions = new List<string>() { "8.0", "9.0", "10.0" };
Copy link
Contributor Author

@imcarolwang imcarolwang May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes:
This list determines the version of WCF packages added to the user's project. If the detected target framework matches any item in the list, the latest WCF package version (8.x) will be added; otherwise, WCF 4.10.x packages will be added.
This change may require a separate PR, but it's included here because the current wcf.git code base uses the 10.0 SDK for test compilation and execution. As a result, test scenarios with the default target framework unexpectedly added the WCF version 4.10.x references, causing numerous baseline mismatch test failures.

public static Version MinSupportedNetFxVersionForDotNet { get; } = new Version("4.5");
public static Version MinSupportedNetStandardVersion { get; } = new Version("1.3");
public static Version MinSupportedNetCoreAppVersion { get; } = new Version("1.0");
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
],
"outputFile": "Reference.cs",
"references": [
"$TEMP$MultiTargetTypeReuse//TypeReuseClient//bin//Debug//net6.0//BinLib.dll"
"$TEMP$MultiTargetTypeReuse//TypeReuseClient//bin//Debug//DOTNET_VERSION//BinLib.dll"
],
"targetFramework": "N.N",
"typeReuseMode": "All"
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
"references": [
"dotnet-svcutil-lib, {dotnet-svcutil-lib, 99.99.99}",
"Microsoft.ApplicationInsights, {Microsoft.ApplicationInsights, 99.99.99}",
"Microsoft.DotNet.InternalAbstractions, {Microsoft.DotNet.InternalAbstractions, 99.99.99}",
"Microsoft.Extensions.DependencyModel, {Microsoft.Extensions.DependencyModel, 99.99.99}",
"Newtonsoft.Json, {Newtonsoft.Json, 99.99.99}",
"NuGet.Common, {NuGet.Common, 99.99.99}",
@@ -24,33 +23,8 @@
"NuGet.ProjectModel, {NuGet.ProjectModel, 99.99.99}",
"NuGet.Protocol, {NuGet.Protocol, 99.99.99}",
"NuGet.Versioning, {NuGet.Versioning, 99.99.99}",
"System.AppContext, {System.AppContext, 99.99.99}",
"System.Collections, {System.Collections, 99.99.99}",
"System.Diagnostics.Debug, {System.Diagnostics.Debug, 99.99.99}",
"System.Diagnostics.DiagnosticSource, {System.Diagnostics.DiagnosticSource, 99.99.99}",
"System.Dynamic.Runtime, {System.Dynamic.Runtime, 99.99.99}",
"System.IO, {System.IO, 99.99.99}",
"System.IO.FileSystem, {System.IO.FileSystem, 99.99.99}",
"System.IO.FileSystem.Primitives, {System.IO.FileSystem.Primitives, 99.99.99}",
"System.Linq, {System.Linq, 99.99.99}",
"System.Linq.Expressions, {System.Linq.Expressions, 99.99.99}",
"System.ObjectModel, {System.ObjectModel, 99.99.99}",
"System.Reflection, {System.Reflection, 99.99.99}",
"System.Reflection.Emit, {System.Reflection.Emit, 99.99.99}",
"System.Reflection.Emit.ILGeneration, {System.Reflection.Emit.ILGeneration, 99.99.99}",
"System.Reflection.Primitives, {System.Reflection.Primitives, 99.99.99}",
"System.Reflection.TypeExtensions, {System.Reflection.TypeExtensions, 99.99.99}",
"System.Runtime, {System.Runtime, 99.99.99}",
"System.Runtime.Extensions, {System.Runtime.Extensions, 99.99.99}",
"System.Runtime.Handles, {System.Runtime.Handles, 99.99.99}",
"System.Runtime.InteropServices, {System.Runtime.InteropServices, 99.99.99}",
"System.Runtime.InteropServices.RuntimeInformation, {System.Runtime.InteropServices.RuntimeInformation, 99.99.99}",
"System.Runtime.Loader, {System.Runtime.Loader, 99.99.99}",
"System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 99.99.99}",
"System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 99.99.99}",
"System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 99.99.99}",
"System.Text.Encoding, {System.Text.Encoding, 99.99.99}",
"System.Threading.Tasks, {System.Threading.Tasks, 99.99.99}"
"System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 99.99.99}"
],
"targetFramework": "N.N",
"typeReuseMode": "All"
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
"references": [
"dotnet-svcutil-lib, {dotnet-svcutil-lib, 99.99.99}",
"Microsoft.ApplicationInsights, {Microsoft.ApplicationInsights, 99.99.99}",
"Microsoft.DotNet.InternalAbstractions, {Microsoft.DotNet.InternalAbstractions, 99.99.99}",
"Microsoft.Extensions.DependencyModel, {Microsoft.Extensions.DependencyModel, 99.99.99}",
"Newtonsoft.Json, {Newtonsoft.Json, 99.99.99}",
"NuGet.Common, {NuGet.Common, 99.99.99}",
@@ -24,33 +23,8 @@
"NuGet.ProjectModel, {NuGet.ProjectModel, 99.99.99}",
"NuGet.Protocol, {NuGet.Protocol, 99.99.99}",
"NuGet.Versioning, {NuGet.Versioning, 99.99.99}",
"System.AppContext, {System.AppContext, 99.99.99}",
"System.Collections, {System.Collections, 99.99.99}",
"System.Diagnostics.Debug, {System.Diagnostics.Debug, 99.99.99}",
"System.Diagnostics.DiagnosticSource, {System.Diagnostics.DiagnosticSource, 99.99.99}",
"System.Dynamic.Runtime, {System.Dynamic.Runtime, 99.99.99}",
"System.IO, {System.IO, 99.99.99}",
"System.IO.FileSystem, {System.IO.FileSystem, 99.99.99}",
"System.IO.FileSystem.Primitives, {System.IO.FileSystem.Primitives, 99.99.99}",
"System.Linq, {System.Linq, 99.99.99}",
"System.Linq.Expressions, {System.Linq.Expressions, 99.99.99}",
"System.ObjectModel, {System.ObjectModel, 99.99.99}",
"System.Reflection, {System.Reflection, 99.99.99}",
"System.Reflection.Emit, {System.Reflection.Emit, 99.99.99}",
"System.Reflection.Emit.ILGeneration, {System.Reflection.Emit.ILGeneration, 99.99.99}",
"System.Reflection.Primitives, {System.Reflection.Primitives, 99.99.99}",
"System.Reflection.TypeExtensions, {System.Reflection.TypeExtensions, 99.99.99}",
"System.Runtime, {System.Runtime, 99.99.99}",
"System.Runtime.Extensions, {System.Runtime.Extensions, 99.99.99}",
"System.Runtime.Handles, {System.Runtime.Handles, 99.99.99}",
"System.Runtime.InteropServices, {System.Runtime.InteropServices, 99.99.99}",
"System.Runtime.InteropServices.RuntimeInformation, {System.Runtime.InteropServices.RuntimeInformation, 99.99.99}",
"System.Runtime.Loader, {System.Runtime.Loader, 99.99.99}",
"System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 99.99.99}",
"System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 99.99.99}",
"System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 99.99.99}",
"System.Text.Encoding, {System.Text.Encoding, 99.99.99}",
"System.Threading.Tasks, {System.Threading.Tasks, 99.99.99}"
"System.Security.Cryptography.ProtectedData, {System.Security.Cryptography.ProtectedData, 99.99.99}"
],
"targetFramework": "N.N",
"typeReuseMode": "All"
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
// </auto-generated>
//------------------------------------------------------------------------------

namespace TFnetcoreapp3_1_NS
namespace ServiceReference
{
using System.Runtime.Serialization;

@@ -34,63 +34,26 @@ public string Value
}
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.Runtime.Serialization.DataContractAttribute(Name="TypeReuseCompositeType", Namespace="http://schemas.datacontract.org/2004/07/TypesLib")]
public partial class TypeReuseCompositeType : object
{

private bool BoolValueField;

private string StringValueField;

[System.Runtime.Serialization.DataMemberAttribute()]
public bool BoolValue
{
get
{
return this.BoolValueField;
}
set
{
this.BoolValueField = value;
}
}

[System.Runtime.Serialization.DataMemberAttribute()]
public string StringValue
{
get
{
return this.StringValueField;
}
set
{
this.StringValueField = value;
}
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="TFnetcoreapp3_1_NS.ITypeReuseSvc")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference.ITypeReuseSvc")]
public interface ITypeReuseSvc
{

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetData", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataResponse")]
System.Threading.Tasks.Task<TFnetcoreapp3_1_NS.BinLibrary> GetDataAsync(int value);
System.Threading.Tasks.Task<ServiceReference.BinLibrary> GetDataAsync(int value);

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContract", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContractResponse")]
System.Threading.Tasks.Task<TFnetcoreapp3_1_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(TFnetcoreapp3_1_NS.TypeReuseCompositeType composite);
System.Threading.Tasks.Task<TypesLib.TypeReuseCompositeType> GetDataUsingDataContractAsync(TypesLib.TypeReuseCompositeType composite);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public interface ITypeReuseSvcChannel : TFnetcoreapp3_1_NS.ITypeReuseSvc, System.ServiceModel.IClientChannel
public interface ITypeReuseSvcChannel : ServiceReference.ITypeReuseSvc, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public partial class TypeReuseSvcClient : System.ServiceModel.ClientBase<TFnetcoreapp3_1_NS.ITypeReuseSvc>, TFnetcoreapp3_1_NS.ITypeReuseSvc
public partial class TypeReuseSvcClient : System.ServiceModel.ClientBase<ServiceReference.ITypeReuseSvc>, ServiceReference.ITypeReuseSvc
{

/// <summary>
@@ -133,12 +96,12 @@ public TypeReuseSvcClient(System.ServiceModel.Channels.Binding binding, System.S
{
}

public System.Threading.Tasks.Task<TFnetcoreapp3_1_NS.BinLibrary> GetDataAsync(int value)
public System.Threading.Tasks.Task<ServiceReference.BinLibrary> GetDataAsync(int value)
{
return base.Channel.GetDataAsync(value);
}

public System.Threading.Tasks.Task<TFnetcoreapp3_1_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(TFnetcoreapp3_1_NS.TypeReuseCompositeType composite)
public System.Threading.Tasks.Task<TypesLib.TypeReuseCompositeType> GetDataUsingDataContractAsync(TypesLib.TypeReuseCompositeType composite)
{
return base.Channel.GetDataUsingDataContractAsync(composite);
}
@@ -148,10 +111,12 @@ public virtual System.Threading.Tasks.Task OpenAsync()
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
}

#if !NET6_0_OR_GREATER
public virtual System.Threading.Tasks.Task CloseAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose));
}
#endif

private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"providerId": "Microsoft.Tools.ServiceModel.Svcutil",
"version": "99.99.99",
"options": {
"inputs": [
"$testCasesPath$/wsdl/TypeReuseSvc.wsdl"
],
"namespaceMappings": [
"*, ServiceReference"
],
"outputFile": "Reference.cs",
"references": [
"$TEMP$NetStandard20TypeReuse//TypeReuseClient//bin//Debug//netstandard2.0//TypesLib.dll",
"System.Runtime, {System.Runtime, 99.99.99}",
"System.Runtime.Serialization.Primitives, {System.Runtime.Serialization.Primitives, 99.99.99}"
],
"targetFramework": "netstandard2.0",
"typeReuseMode": "All"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>N.N</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../TypesLib/TypesLib.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
// </auto-generated>
//------------------------------------------------------------------------------

namespace TFnet5_0_NS
namespace elm_NS
{
using System.Runtime.Serialization;

@@ -72,25 +72,25 @@ public string StringValue
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="TFnet5_0_NS.ITypeReuseSvc")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="elm_NS.ITypeReuseSvc")]
public interface ITypeReuseSvc
{

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetData", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataResponse")]
System.Threading.Tasks.Task<TFnet5_0_NS.BinLibrary> GetDataAsync(int value);
System.Threading.Tasks.Task<elm_NS.BinLibrary> GetDataAsync(int value);

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContract", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContractResponse")]
System.Threading.Tasks.Task<TFnet5_0_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(TFnet5_0_NS.TypeReuseCompositeType composite);
System.Threading.Tasks.Task<elm_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(elm_NS.TypeReuseCompositeType composite);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public interface ITypeReuseSvcChannel : TFnet5_0_NS.ITypeReuseSvc, System.ServiceModel.IClientChannel
public interface ITypeReuseSvcChannel : elm_NS.ITypeReuseSvc, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")]
public partial class TypeReuseSvcClient : System.ServiceModel.ClientBase<TFnet5_0_NS.ITypeReuseSvc>, TFnet5_0_NS.ITypeReuseSvc
public partial class TypeReuseSvcClient : System.ServiceModel.ClientBase<elm_NS.ITypeReuseSvc>, elm_NS.ITypeReuseSvc
{

/// <summary>
@@ -133,12 +133,12 @@ public TypeReuseSvcClient(System.ServiceModel.Channels.Binding binding, System.S
{
}

public System.Threading.Tasks.Task<TFnet5_0_NS.BinLibrary> GetDataAsync(int value)
public System.Threading.Tasks.Task<elm_NS.BinLibrary> GetDataAsync(int value)
{
return base.Channel.GetDataAsync(value);
}

public System.Threading.Tasks.Task<TFnet5_0_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(TFnet5_0_NS.TypeReuseCompositeType composite)
public System.Threading.Tasks.Task<elm_NS.TypeReuseCompositeType> GetDataUsingDataContractAsync(elm_NS.TypeReuseCompositeType composite)
{
return base.Channel.GetDataUsingDataContractAsync(composite);
}
@@ -148,10 +148,12 @@ public virtual System.Threading.Tasks.Task OpenAsync()
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
}

#if !NET6_0_OR_GREATER
public virtual System.Threading.Tasks.Task CloseAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose));
}
#endif

private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/Simple.wsdl"
],
"namespaceMappings": [
"*, TFnet5_0_NS"
"*, elm_NS"
],
"outputFile": "Reference.cs",
"references": [
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>N.N</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
<PackageReference Include="System.ServiceModel.*", Version="N.N.N">
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"providerId": "TFnet5_0",
"providerId": "elm",
"version": "99.99.99",
"options": {
"inputs": [
"$testCasesPath$/wsdl/Simple.wsdl"
],
"bootstrapPath": "$resultPath$/TestBootstrap/ParamsFiles_SDK_TFM/TFnet5_0",
"bootstrapPath": "$resultPath$/TestBootstrap/ParamsFiles/elm",
"namespaceMappings": [
"*, TFnet5_0_NS"
"*, elm_NS"
],
"noLogo": true,
"noTelemetry": true,
"outputDir": "$resultPath$/TestResults/ParamsFiles_SDK_TFM/TFnet5_0",
"projectFile": "$resultPath$/TestResults/ParamsFiles_SDK_TFM/TFnet5_0/TFnet5_0.csproj",
"outputDir": "$resultPath$/TestResults/ParamsFiles/elm",
"projectFile": "$resultPath$/TestResults/ParamsFiles/elm/elm.csproj",
"references": [
"Newtonsoft.Json, {Newtonsoft.Json, 99.99.99}"
],

This file was deleted.

This file was deleted.

Loading