I like to separate my WCF projects out like this:
- a class library with the contracts - all your service contracts, data contracts etc. If your solution gets large, this might even be several class libraries, each handling one area/topic of your solution
- a class library with the service implementation - again, if you have lots of services, maybe you'll even go for several class libraries
a Winforms or console app as service host - for testing and debugging purposes
a class library for the client proxy/proxies - again, if it makes sense, this could be several libraries even - one for each "logical subsystem"
- and finally your actual client - a Winforms, WPF, whatever app that actually consumes and uses those client proxies
The reasoning behind this is that I want to have a clear separation of concerns - since the services share nothing but the contracts (service and data contracts) that belongs into a separate assembly. Since the service host really has nothing to do with the service impmlementation, these two should be separated as well.
In your case, you would have your Winforms app (or apps) be the actual service hosts - e.g. your would instantiate a ServiceHost
class inside your Winforms app, and host the appropriate service (from the services assembly) inside that ServiceHost
- and of course, you can have as many service hosts as you need! (one per service you need to make available)
On the client side it pays off to put the proxies into a separate assembly since that assembly can now be shared amongst several client projects while having the code in just a single location.
And since I have the contracts in a separate assembly, as long as I control both ends of the .NET-to-.NET communication, I can actually share that assembly between the server and the client and reuse the same types - instead of having the client create its own, separate data types.
A lot of those things are taken from Miguel Castro's excellent Extreme WCF screencast - definitely worth a look! (same goes for Keith Elder's Demystifying WCF - also excellent stuff!)