Moving WCF contracts to a separate dll

后端 未结 3 1689
情话喂你
情话喂你 2021-01-06 09:58

I want to move WCF contracts interfaces to third DLL and start consuming them from clients when I am generating proxy by hand.

Do those interfaces in the DLL have to

3条回答
  •  清酒与你
    2021-01-06 10:12

    It is very common practice to put WCF data and service contract to separate assembly. In my previous project we used naming like Company.OurProject.Contracts.dll. I think that to generate proxy with reusing existing classes you should put your interfaces for service contracts (those marked with [ServiceContractAttribute]) and corresponding data contracts to that assembly. I would avoid putting there actual implementation of the services.

    Here is another great answer on SO with more insight into what can be reused when "Reuse types in referenced assemblies" is selected: WCF Service Reference generates its own contract interface, won't reuse mine

提交回复
热议问题