问题
I have a WCF service library containing two services. These two services share a common set of classes in their operations.
When I generate the WCF proxies with svcutil.exe, I get two sets of proxy classes (one for each service). Is there any way to have it only generate one set of these shared classes? Or will I have to partition these classes into separate namespaces?
回答1:
You can supply multiple service endpoint URI's to the svcutil.exe command line. When you specify more than one endpoint URI, any types that share a common schema will be generated once and reused amongst all service contracts.
http://msdn.microsoft.com/en-us/library/aa347733.aspx
来源:https://stackoverflow.com/questions/1163506/svcutil-exe-redundant-proxy-classes