I’ve been building a WCF app behind 3 projects (contract,implementation,client) I’ve hosted my service as a console app with basic HTTP binding. I’m now ready to move it to IIS. However, the tutorial for creating a .svc file shows it actually implementing the contract – but I already have an implementation. How do I just redirect to that implementation or should I be adding a .svc file to my existing implementation project?
Hope that’s clear enough.
Cheers,
Rob
I normally add the SVC file in, and the ServiceHost will point to the same class that you would when you create a new instance of a ServiceHost from Code.
So your CommandLine host might look like:
And your .svc file would look like:
So now you have your app hostable in IIS and also from the commandline.
I normally just knock up the svc file when I am ready to deploy.
Paul.