Sunday, October 10, 2010

Point WCF .Svc file to Assembly in the GAC

Separating .SVC file from the WCF code

There are times when you want to package up all your web services into a dll and install in into the GAC. I had to do this on one of my recent Sharepoint/ Silverlight applications. I needed to install the the .SVC file in the Layouts directory of Sharepoint, but I didn't want all the other code there. So i performed the following steps.

  1. Created an Interface for my service and created my service.
  2. Created a .SVC file and stored it into the WebPart project in the 12/Templates/Layouts directory.
  3. Update the .SVC file to point to your Assembly and Service namespace.



Now when you call your service URL http://..../service.svc it will reference the .dll in the GAC

No comments:

Post a Comment