2013-12-21 28 views
3

我有一個服務器上安裝了Shrepoint。引用到Microsoft.SharePoint.dll

我要測試的這款代碼:

SPUtility.GetLocalizedString Method

當我添加引用Microsoft.SharePoint.dll的,我可以解決SPSite和...。問題是,當我要建立的項目它不承認任何using Microsoft.SharePoint更多:

enter image description here

,我得到這個錯誤:

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

問題在哪裏?我想補充參考Microsoft.SharePoint.dll但在編譯的時候它沒有工作

+0

http://stackoverflow.com/questions/332906/where-is-the-location-of-microsoft-sharepoint-dll tl; dr - 您必須在安裝SP的計算機上開發:/ – brandonscript

+0

I在機器上開發的SP上安裝了它 – Arian

+0

哦!恩..恩。我已經嘗試過一次,爲我工作..除此之外,對不起,我無法幫助。 – brandonscript

回答

2

Microsoft.SharePoint.dll的從SharePoint 2010中使用框架3.5 但 Microsoft.SharePoint.dll的從SharePoint 2013使用框架4.0

嘗試。

0

嘗試使用此命名空間:

using Microsoft.SharePoint.Utilities 

在你給的鏈接,它說,該方法駐留在命名空間Microsoft.SharePoint.Utilities而不是Microsoft.SharePoint。這只是一個猜測,也許工作,沒有測試過,

2

變化Visual Studio項目的解決方案性能平臺目標x64和目標框架的.NET Framework 3.5。