There are two ways to handle the code for service and data contract classes WCF clients.
- Generate everything using svcutil.exe. Don't have any kind of reference from your client project to the service assembly. Just use the classes generated by svcutil.
- Reference the assemblies containing the types directly. I sometimes use a separate assembly for my DTO classes, that is references from both the client and the server. When generating the client code with svcutil, use the
/reference:<file path>
option to tell svcutil to reuse the types from an existing assembly instead of regenerating them.
If you reference the origin assembly, without passing it with /reference
to svcutil you'll end up with a mess of conflicts. I guess that's what happened to you.