How can I get a C# class library to have WCF services? I have WCF services added in there, just that I can’t get it to run since it complains that the project type of Class library cannot be set as startup. Any ideas?
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.
Well, the WCF service implementation in your class library needs to be hosted somewhere – either in IIS (like the legacy ASMX web services), or you can self-host.
See MSDN for How to host a WCF service in a managed application (self-hosting) or How to host a service in IIS.
In addition, Visual Studio 2008 also has a “generic” service host application in its Common7/IDE folder, called “WcfSvcHost.exe”. See the MSDN docs on that. You can set up your Visual Studio class library project to automatically launch this service host app to host your service, so you can test it.