c# - WCF Service in Separate Assembly -


What is the correct way to create a WCF service in a separate assembly, but then in the same solution, through a web project Expand the end point

I did it like this:

    < Li> Create your own class library
  • WCF service in a new project, in this library, your interface in a namespace like MyServiceLib
  • your web page Add a code to a code such as MyService.svc , with only one statement, the instruction command:

       

    Where MyServiceLib is the namepace name for your WCF service and MyService is the name of your service implementation class. (This simple setup is for the case when you deploy your service in a compiled assembly (for example, in the bin directory). If you want to deploy with the source and first If you want to conform to the request, then you can add some more features in Service Host Directive (programming language, source file, etc.)

  • web.config Keep it in the & lt; system.serviceModel & gt; section.

Comments