Ive written a service and it has a .svc file. I can browse to this service but this seems to be a strange way of doing it. Im wondering whether is okay to produce a service using a .svc file or should we be looking at using the WCF Service Host and setting up the bindings etc....

3 Answers
3

An svc file is for when you're hosting within IIS (it can now host without these in .NET 4.0). Unless you have a reason to self host I'd strongly recommend sticking with IIS (WAS) as it provides so much of the hosting infrastructure for "free".

Cool yeah just reading about the self hosting I guess if we wanted to allow TCP bindings we would self host. For our needs a .svc in IIS will do thanks!
–
ExitosJun 14 '11 at 12:19

@Pete2k You can also use WAS for TCP bindings. In fact the core purpose of WAS in IIS7 is to provide hosting capabilities beyond just HTTP. To get your solution talking over TCP just requires the addition of a TCP Endpoint definition alongside your HTTP one in your config (and the appropriate firewall restrictions lifted for remote clients).
–
Darren LewisJun 14 '11 at 12:34

Well, In WCF you are not restricted to hosting in just IIS. The .svc file is equivalent to an asmx file. If you are going to host in IIS, I have used the .svc file, but if I am hosting in a console app or windows service, I instantiate the service through ServiceHost.