Saturday, 16 January 2010

WCF with out a codefile

I’m always forgetting this.  If you want to use wcf using an assembly instead of a code file here is what you have to do.

  1. Add the assembly as a reference.
  2. change the svc file mark up to
       1: <%@ ServiceHost Service="<Concrete Class>"  %>





  3. Change the service configuration in the web.config





       1: <service behaviorConfiguration="tricoder_serviceBehavior" name="<Concrete Class">



       2:   <endpoint address="" binding="basicHttpBinding" bindingConfiguration=""



       3:    contract="Interface with contracts" >



       4:   </endpoint>



       5:   <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />



       6:  </service>



       7: </services>










    And make sure that you use the full name of the concrete class and the interface.




    Technorati Tags: ,

    No comments:

    Post a Comment