Search code examples
c#c#-4.0sharepointsharepoint-2010

Reference to Microsoft.SharePoint.dll


I have a server that Shrepoint installed on it.

I want to test this code:

SPUtility.GetLocalizedString Method

When I add reference to Microsoft.SharePoint.dll I can resolve SPSite and ... .The problem is When I want to build the project it does not recognize using Microsoft.SharePoint any more:

enter image description here

and I get this error:

Error 13 The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

where is the problem? I add reference to Microsoft.SharePoint.dll but in build time it does not works


Solution

  • Microsoft.SharePoint.dll from SharePoint 2010 use Framework 3.5 but Microsoft.SharePoint.dll from SharePoint 2013 use Framework 4.0

    try it.