What's the most common/best way to setup a WCF service project and applications?
Here's an example:
- Solution: "MyProject"
- Class Library: "MyProject.Common"
- Contains ServiceContract interface, and any DataContracts
- Class Library: "MyProject.Impl"
- Contains implementation of service contract, and a client class that can be used to call the service
- WCF Service Web Application: "MyProject.Service"
- Contains references to MyProject.Common and Impl, so that it can host the service
- WCF service app would configure the endpoints in the web.config
- ASP.NET Web Application: "MyProject.Web"
- Contains references to "MyProject.Common" and "MyProject.Impl" so that it can use the client class
- Web app would also need to configure the endpoints in the web.config, etc.
My question is whether it makes sense to split the contract and implementation into separate DLLs, and whether the application(s) should reference the Common/Impl libraries, or if the application(s) should just make a service reference (using "Create Service Reference" or SvcUtil). I'm thinking it might make sense for the apps to just make a service refernce, so you don't couple the Common/Impl to the app. In this case, does it even make sense to create a client class in MyService.Impl?