2013-12-23 67 views
3

爲了給您提供完整的透視圖,我試圖在SharePoint中創建自定義功能區。爲此,我正在關注此tutorial。我創建了所需的功能,並能夠使用簡單的JavaScript警報進行部署和測試。現在我試圖通過單擊功能區按鈕來調用ASPX頁面。接收錯誤「無法找到類型或名稱空間名稱LayoutsPageBase」

爲此,我在我的項目中創建了一個應用程序頁面。但在後面的ASP.NET頁的文件中的代碼,我得到以下錯誤:

The type or namespace name 'LayoutsPageBase' could not be found (are you missing a using directive or an assembly reference?) 
C:\Users\Administrator\Documents\Visual Studio 2012\Projects\CustomRibbonButton\CustomRibbonButton\Layouts\CustomRibbonButton\ApplicationPage1.aspx.cs 

我已經進口的(我希望這就是你在C#中調用它)Microsoft.SharePoint.WebControls with語句using Microsoft.SharePoint.WebControls;

this question在計算器上我能夠確定LayoutsPageBase課程在沙盒解決方案中不可用(路徑爲\UserCode\assemblies)。

所以在我的項目中,我去了References > Microsoft.SharePoint,右鍵點擊它來查看它的屬性。屬性窗口中的Path顯示爲C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll

這個錯誤的原因是什麼?如何解決?

+0

@RobH:我選擇了農場解決方案。路徑C:\ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 15 \ ISAPI \ Microsoft.SharePoint.dll是農場解決方案,對吧?如何在創建解決方案後檢查它是沙箱還是農場解決方案? – Naveen

+0

@RobH:我按照你的說法檢查了沙盒解決方案,並將其設置爲true。謝謝!但是'Microsoft.SharePoint.dll'的路徑仍然讓我感到困惑。 – Naveen

+0

你現在有工作嗎? – RobH

回答

7

通過右鍵單擊解決方案資源管理器中的項目並查看屬性,可以檢查SharePoint項目是否爲沙盒。

有一個真/假的屬性,被稱爲Sandboxed Solution

相關問題