What is the correct way to create a WCF service in separate assembly but then expose its endpoint through a Web Project in the same solution?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve done it this way:
MyServiceLibAdd to your web project a file like
MyService.svcwith only one statement, the ServiceHost directive:where
MyServiceLibis the name of the namespace of your WCF service andMyServicethe name of your service implementation class. (This simple setup is for the case when you deploy your service as a compliled assembly (in theBindirectory for instance). If you want to deploy with source and let complile on first request you need to put some more attributes to the service host directive (Programming language, Source file, etc.)web.configin the<system.serviceModel>section.