locked
Best method to create WCF: with svc or without svc RRS feed

Answers

  • User-417640953 posted

    Hi neoaguil17,

    Thanks for your post.

    Based on your description, I see you are create wcf with .svc file services and also without .svc file service.

    As we all known that the .svc file is equivalent to an asmx file and .svc file wcf service used to be host to web server IIS.

    And if you want to host wcf service with console application or windows service, you should choose the services without .svc files.

    Besides, we can also host the service without .svc file on IIS server by add below web.config.

     <serviceHostingEnvironment >
          <serviceActivations>
            <add factory="System.ServiceModel.Activation.ServiceHostFactory" 
             relativeAddress="~/HostDevServer/HelloWorldService.svc" 
             service="HelloWorldService.HelloWorldService"/>
          </serviceActivations>
     </serviceHostingEnvironment>
    

    Above configuration assign the service a relativeAddress as "~/HostDevServer/HelloWorldService.svc"

    For more information, you can refer to below thread.

    http://stackoverflow.com/questions/6293686/what-is-the-difference-between-using-a-svc-file-and-hosting-the-wcf-service-in

    Hope that helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 11, 2014 4:00 AM