Search code examples
c#wcfsvc

Svc file works without codebehind?


<%@ ServiceHost Language="C#" Debug="true" Service="FirstWcfService.Service1"%>

Im hosting my service at WAS using SVC file:

enter image description here

But as you can see it doesnt have CodeBehind Attrbiute as it should. and its working.

How is that ?

http://msdn.microsoft.com/en-us/library/aa967286.aspx


Solution

  • The service class is compiled into one of the referenced assemblies. The service used is FirstWcfService.Service1 as defined in the svc file:

    Service="FirstWcfService.Service1"
    

    CodeBehind only matters to the tooling (Visual Studio). It doesn't matter at runtime, where the system will only look at what types are declared and used.