Instead of adding service references, you should use svcutil.exe to create a service proxy file for one endpoints together.
All service proxy classes together are in the same namespace that you specify using the switch / n command line.
Then the svcutil.exe call has many parameters. Therefore, I recommend that you store it in a batch file or even more comfortably: place the command call in the "Build Events" section in Visual Studio in the "Prebuild Event Command Line".
Here is the svcutil call for my client, which combines all the proxy classes in ServiceProxy.cs. Most likely, you need to change the path to svcutil.exe and, of course, the service URLs:
"%PROGRAMFILES%\Microsoft SDKs\Windows\v7.0A\bin\svcutil.exe" /noLogo /noConfig /out:"$(ProjectDir)ServiceProxy.cs" /t:code /i /l:cs /tcv:Version35 /ser:DataContractSerializer /ct:System.Collections.Generic.List`1 /n:*,Oe.Corporate.CRMFacade.Service.Test http://localhost:3615/Client010/MasterDataService.svc http://localhost:3615/Client010/BusinessPartnerService.svc http://localhost:3615/Client010/MarketingAttrService.svc http://localhost:3615/Client010/ProductTransactionService.svc http://localhost:3615/Client010/ProductDataService.svc http://localhost:3615/Client010/ActivityManagementService.svc http://localhost:3615/Client010/PromotionService.svc
UPDATE: I forgot to mention that the pre-build event will fail if you do not add this to the bottom of your .csproj file right above the Project closing element:
<Target Name="PreBuildEvent" Condition="'$(PreBuildEvent)'!=''" DependsOnTargets="$(PreBuildEventDependsOn)"> <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" ContinueOnError="true" /> </Target>
source share