You can add your SVC file to your web project to the class contained in a separate DLL. You do not have to have the SVC code in your App_Code directory. It is very easy to do. There should be only one attribute for your SVC file - Service. Here is an example of the one I use where I work:
<%@ ServiceHost Service="My.Qualified.Service.Class.Name" %>
I do not have the code in the App_Code folder. All the logic of this SVC is contained in a separate DLL (which happens My.Qualified.Service.Class.dll). The name of my service is the name of the implementation class; that is the only caveat.
My web.config (inside system.serviceModel) refers to this service as follows:
<service name="My.Qualified.Service.Class.Name">
<endpoint address=""
binding="webHttpBinding"
contract="My.Qualified.Service.Class.IName" />
</service>
My service logic is direct WCF code after that. My interface INamedefines my operations; Nameimplements them.
Hope this helps!
source
share