Search code examples
wcfsharepointsharepoint-2010wcf-data-services

How to refer SharePoint assemblies in a WCF service application?


It gives errors when I refer Microsoft.SharePoint.Administration; Microsoft.Office.Server dlls in a WCF service application. It does not identified the added assemblies. How to resolve this issue?


Solution

  • In which .NET Framework Version is your WCF service written? SharePoint 2010 is implemented using .NET FX 3.5, so you can only reference SharePoint Assemblies if your targeting the same FX Version.

    Your WCF service also has to run on a SharePoint box, it's not possible to reference a SharePoint related assembly on a non SharePoint machine.

    How does your reference looks like? You've to reference the Assemblies from the ISAPI folder within SharePoint Root (which should be Program Files\Common files\Microsoft Shared\Web Server Extensions\14\ISAPI\ by default)