I have Base class for all the DataContracts in my WCF services. When the client is consuming 2 WCF services, both the proxies contain the Base class definition and thus client is not compiling. I tried with giving different namespaces for the derived data contracts, services - nothing worked.
I googled and found 'ServiceKnownType' attribute would address this issue - but didn't work.
I understand the service nature that they should be independent and shouldn't share the contract. But am curious to solve this scenario...any point开发者_如何学JAVAers please
You may put your entities in a separate assembly and reference this assembly in both the client and service. Make sure your service references are configured with the "Use types in referenced assemblies" activated. This can be checked by right-clicking the service reference and selecting "Configure service reference".
精彩评论