You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
My application has 8 Services, so I am running dotnet-svcutil on each service to generate a separate service reference for each with a unique namespace for each. The problem occurs when I consume multiple services in the same client, and reference a data contract that is shared among two or more of the consumed service. In the consuming client, I see a bunch of "'DataContractModel' is an ambiguous reference between 'WS_1_WebServiceNS.Data.DataContractModel' and 'WS_2_WebServiceNS.Data.DataContractModel'". Before conversion, I used this command: "svcutil.exe" ..\My.Service.Contracts.dll /directory:........\deployment to generate a unified wsdl and xsd for shared Data Contracts, and then "svcutil.exe" ..\deployment*.wsdl ..\deployment*.xsd /language:C# /n:http://tempuri.com/MyService/2016/05,WebServiceClient /n:http://tempuri.com/MyServiceData/2016/05,WebServiceClient.Data /o:..\My.Service.Client\MyWebSvcClientApiAuto.cs /config:..\My.Service.Client\App.config
Expected behavior
A method to either generate service references with a shared data component, or an ability to output a generated client class which avoids the namespace collisions.
Am I missing something? The only workaround I can come up with is to somehow merge the 8 wsdl documents, but using the old wsdl tool, won't generate a dotnet Core valid wsdl document.
The text was updated successfully, but these errors were encountered:
I was able to resolve this by using a Reference to the common project where the Model contracts were located. So for each dotnet-svcutil command, I passed a -r "..\My.Services.Models\My.Services.Models.csproj", and now it works like a charm.
Describe the bug
My application has 8 Services, so I am running dotnet-svcutil on each service to generate a separate service reference for each with a unique namespace for each. The problem occurs when I consume multiple services in the same client, and reference a data contract that is shared among two or more of the consumed service. In the consuming client, I see a bunch of "'DataContractModel' is an ambiguous reference between 'WS_1_WebServiceNS.Data.DataContractModel' and 'WS_2_WebServiceNS.Data.DataContractModel'". Before conversion, I used this command: "svcutil.exe" ..\My.Service.Contracts.dll /directory:........\deployment to generate a unified wsdl and xsd for shared Data Contracts, and then "svcutil.exe" ..\deployment*.wsdl ..\deployment*.xsd /language:C# /n:http://tempuri.com/MyService/2016/05,WebServiceClient /n:http://tempuri.com/MyServiceData/2016/05,WebServiceClient.Data /o:..\My.Service.Client\MyWebSvcClientApiAuto.cs /config:..\My.Service.Client\App.config
Expected behavior
A method to either generate service references with a shared data component, or an ability to output a generated client class which avoids the namespace collisions.
Am I missing something? The only workaround I can come up with is to somehow merge the 8 wsdl documents, but using the old wsdl tool, won't generate a dotnet Core valid wsdl document.
The text was updated successfully, but these errors were encountered: